users@glassfish.java.net

Re: Glassfish w/TopLink JPA cascade subsequent delete issue

From: <glassfish_at_javadesktop.org>
Date: Mon, 21 Jun 2010 19:46:29 PDT

Reservation r = em.find(Reservation.class, reservationId);
for(Flt2resv f2r : r.getFlt2resvCollection()){
   em.remove(f2r.getFlight());
}
em.remove(r);


It works every time now that I disabled the EntityManager caching via the persistence.xml.

<property name="toplink.cache.shared.default" value="false"/>

The downside is it now hits the database every single time. We're not a high-traffic site, however, so it isn't a show stopper. I'd like to avoid this however.
[Message sent by forum member 'steven_landers']

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