users@glassfish.java.net

Re: em.flush() doesn't work

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Fri, 29 May 2009 00:00:07 -0700

Are you trying to fetch the data in the same transaction that you persist it? If
not, you won't be able to "see" it until it is committed.

Regards,
-marina

glassfish_at_javadesktop.org wrote:
> I use NB 6.5.1, glassfish 2.1, EJB 3, Toplink persistence to MySQL. Project logic is servlet triggers EJB, then EJB to process and em.persist (myobject) to DB. The program works. But all my rows in DB are readable by MySQL client only after the program finished all records. During the execution, SELECT returns empty. I've tried to add em.flush() after em.persist(myobject), but still the same. Why flush() doesn't flush the dirty ones to DB? Any thing I need to set in the persistance unit xml or in MySQL?
> [Message sent by forum member 'senderj' (senderj)]
>
> http://forums.java.net/jive/thread.jspa?messageID=348250
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>