"JUnkie" wrote : I always managed to avoid entity updates after a persist in 
the same method call... 

May I ask why? By itself persist() doesn't necessarily triggers DB call, just 
introduces the object to the persistence context. If I make an update later, 
should be fine, the important thing is that all changes are flushed before the 
transaction commits. 

anonymous wrote : 
  | however what happens if you add
  | card = entityManager.merge(card);
  | directly after the persist call?

Nothing changes. The same "old" record in the DB. 

Now again, after persist() finishes the object is already in the persistent 
context, unless it is wrapped in some sort of dynamic proxy object which is 
later saved into the DB instead of the original object.

However I don't recall anything anywhere that would mention calling persist() 
the last method in your transaction, so to avoid changes between persist() and 
transaction commit.



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112681#4112681

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112681
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to