Wicket and JPA(EntityManager PersistenceContextType)?

2008-04-02 Thread Nino Saturnino Martinez Vazquez Wael
I know this is not completely related. But here goes anyway. I have an application with several different flows. If I switch from extended to transaction, suddenly the values in my form aren't save to the database(but they are saved in memory), I use spring to instantiate entitymanager and

Re: Wicket and JPA(EntityManager PersistenceContextType)?

2008-04-02 Thread Meindert Deen
my 2 cents, don't know if this is your problem: The transaction based entity manager only commits if the update of the data is within a transaction. So you must wrap your update in a transaction (you said you used Spring, so you can configure this in your Spring xml or use the annotation based

Re: Wicket and JPA(EntityManager PersistenceContextType)?

2008-04-02 Thread Nino Saturnino Martinez Vazquez Wael
Any help apreciated...:) These lines should take care of transaction wrapping right?: From my spring xml: bean id=txManager class=org.springframework.orm.jpa.JpaTransactionManager property name=entityManagerFactory ref=entityManagerFactory / /bean

Re: Wicket and JPA(EntityManager PersistenceContextType)?

2008-04-02 Thread Nino Saturnino Martinez Vazquez Wael
Hmm thinking over this again. I thought that after you persisted something, JPA would handle it for you. So what you are saying are that if I get a object from the persistance manager, and then update something directly on the POJO i would then have to begin a transaction and commit it? So

Re: Wicket and JPA(EntityManager PersistenceContextType)?

2008-04-02 Thread Meindert Deen
As I understand it, then your second email is correct. If you don't run the getting and updating of your components in a transaction, your Entity gets decoupled (JPA default behavior is to decouple the Entities outside of a transaction), so it will not save any updates done outside of the

Re: Wicket and JPA(EntityManager PersistenceContextType)?

2008-04-02 Thread Meindert Deen
FYI: Reference blog post: http://weblogs.java.net/blog/davidvc/archive/2007/04/jpa_and_rollbac.html On Wed, Apr 2, 2008 at 3:55 PM, Meindert Deen [EMAIL PROTECTED] wrote: As I understand it, then your second email is correct. If you don't run the getting and updating of your components in a

Re: Wicket and JPA(EntityManager PersistenceContextType)?

2008-04-02 Thread Nino Saturnino Martinez Vazquez Wael
thanks.. I think i'll continue on OpenJPA user forum Meindert Deen wrote: FYI: Reference blog post: http://weblogs.java.net/blog/davidvc/archive/2007/04/jpa_and_rollbac.html On Wed, Apr 2, 2008 at 3:55 PM, Meindert Deen [EMAIL PROTECTED] wrote: As I understand it, then your second email