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