[jboss-user] [JBoss Seam] - Re: persist() / remove() at end of long running conversation

christian.bauer@jboss.com do-not-reply at jboss.com
Fri Jan 5 09:45:53 EST 2007


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



More information about the jboss-user mailing list