users@glassfish.java.net

Glassfish Caching OneToMany Relations

From: <glassfish_at_javadesktop.org>
Date: Tue, 29 Apr 2008 15:21:07 PDT

Entity "A" has one-to-many relation with entity "B". Can persist "A", several "B", merge multiple "B" into "A" using servlet (thus remote EJB3 with serializing).

Then use different servlet to query database and find everything OK. Entity "A" exists. Set of "B" is properly populated (after enhancing session bean to check "size" of set to initialize the lazy load). Can successfully traverse the set of "B" in "A".

Can kill the browser session, start a new browser session, rerun the query servlet, data still good.

Then stop and restart Glassfish, start new browser session, run query servlet, and one-to-many relation data is lost. "A" and "Bs" still in database. But set of "B" in "A" reports size zero.

Glassfish thus appears to be caching relation data. How to force relation data to be flushed? Using MyEclipse to control start/stop Glassfish. Thanks.
[Message sent by forum member 'franknatoli' (franknatoli)]

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