-
1. Re: autocommit on cmp
guurk Mar 31, 2005 9:23 AM (in response to guurk)Ok, so I'm reading a little bit more through the spec sheets.
My entities are becoming detached since I'm getting them via a query and outside a transaction context.
So now I just have to figure out how to get managed entities if I have to look them up via a non PK field. -
2. Possible Bug?
guurk Mar 31, 2005 9:34 AM (in response to guurk)One more thing.
I notice in my tests that there seems to be a bug.
You can get a detached instance and then call persist with it on the entitymanager.
Based on the spec it's supposed to throw an IllegalArgumentException. Instead it created a new managed instance. -
3. Re: autocommit on cmp
bill.burke Mar 31, 2005 9:35 AM (in response to guurk)You reattached via the merge() or refresh() methods.
-
4. Re: autocommit on cmp
bill.burke Mar 31, 2005 9:37 AM (in response to guurk)FYI flush mode pertains to database synchronization, not transaction commit. Look at section 4.4.1 of the Persistence spec for more detail.
-
5. Re: autocommit on cmp
bill.burke Mar 31, 2005 9:46 AM (in response to guurk)FYI flush mode pertains to database synchronization, not transaction commit. Look at section 4.4.1 of the Persistence spec for more detail.
-
6. Re: autocommit on cmp
guurk Mar 31, 2005 9:53 AM (in response to guurk)Deal, my fault for confusing the issue b/t commit and synch.
Truly I'd rather not have to deal with either in my current application. When a change is made on the entity I want it immediatly reflected in the database, and viceversa.
So, no transactions and immediate synchronization. -
7. Re: autocommit on cmp
bill.burke Mar 31, 2005 10:28 AM (in response to guurk)sorry, you can only reattach with merge(). Refresh() requires a managed object.