users@glassfish.java.net

shared cache, toplink.refresh hint and multiple persistence units

From: <glassfish_at_javadesktop.org>
Date: Wed, 06 Aug 2008 13:11:29 PDT

Hi,

Using Version 2 UR2.

After turning on the shared cache, I had issues with entities not being refreshed even after database data changes. This was adequately addressed by using the toplink.refresh hint.

Then we switched to using 2 persistence units instead of one. In our development environment, the 2 persistence units point to the same database and looking at the same data. Only one of them writes, the other being for readonly accesses (this is to mimic the master/slave production setup, in which the problem also happens). And the hint ceased to have the desired effect. The problem does not occur if I switch off the shared cache.

If this is not the expected behavior, how should I debug this?

If I make a change using PU1 (read/write), what does it take for the change to be seen immediately in PU2 (read only), assuming I want to make use of the shared cache?

Thanks
[Message sent by forum member 'jbelis' (jbelis)]

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