users@glassfish.java.net

Re: Questions on EJB 3.0 and data retrieval.

From: <glassfish_at_javadesktop.org>
Date: Thu, 10 May 2007 12:34:32 PDT

What you are describing is that your queries go to the cache. Refresh was provided to ensure that you use current data when there are concurrent modifications going on, but for the most part, using a cache speeds things up for simple applications.

What you can do is setup your queries to use the toplink.refresh
query hint described:
  http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html

Or as a last resort, you can set the caching on an entity by entity basis to reflect the needs of your app - possibly disabling it for entities that are changed externally frequently.

Best Regards,
Chris
[Message sent by forum member 'chris_delahunt' (chris_delahunt)]

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