users@glassfish.java.net

Re: em.flush() doesn't work

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 01 Jun 2009 11:00:35 -0700

Flush doesn't guarantee the commit, and the 1st one that fails will rollback the
whole tx. There is no generic way to commit after nth persist or merge - it
needs to be your app's logic that does it. If you can't use container managed
transactions for that, switch to UserTransaction that you can control.

HTH,
-marina

glassfish_at_javadesktop.org wrote:
> Thanks for all the replies here. I understand about the commit. But what I want to do is to flush the dirty before the whole process completes. Is there any method in EJB or any setting in the container I can commit after persisting an object? Or commit every 500 objects? I don't want to rerun the whole thing just because the last object failed. Please help
> [Message sent by forum member 'senderj' (senderj)]
>
> http://forums.java.net/jive/thread.jspa?messageID=348532
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>