persist(), even with FlushMode.MANUAL, will do an immediate SQL INSERT if the 
identifier generator of the entity requires this. For example, 'identity' does, 
while 'sequence' can generate identifier values pre-INSERT. 

If you call persist() outside of transaction boundaries 
(TransactionType.NOT_SUPPORTED on your EJB method), it is allowed to defer 
insertion for pre- and post-insert identifier generators. The entity instance 
is then considered managed, but hasn't an identifier value assigned until the 
next flush of the persistence context occurs.

http://www.manning.com/bauer2



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

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

Reply via email to