users@glassfish.java.net

em.flush and commit

From: <glassfish_at_javadesktop.org>
Date: Fri, 22 Feb 2008 02:08:33 PST

In an container managed context. (Glassfish + Toplink).

 @PersistenceContext
    EntityManager em;

{ Entity a = em.find(Entity.class,1);
  a.setName("hello1");
  em.merge(a);
  em.flush();
  1/0; //Exception occurs
  ..
}

The transaction was rollback and entity a is not merged even if flush was called before.
So, How I can avoid rollback after a fixed point?
[Message sent by forum member 'peppeme' (peppeme)]

http://forums.java.net/jive/thread.jspa?messageID=260402