users@glassfish.java.net

Re: Surprising JPA (Toplink) Behaviour (glassfish v1 UR1)

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 Mar 2007 06:36:36 PST

[i]I'm not an expert on the subject but ran into something similar. I
found that when other programs changed records in a table that I had
previously loaded using JPA entities, when I queried the table again the
fresh data was not loaded. This is because of caching. I ended up
having to disable caching using a query hint. I don't remember the
syntax off the top of my head but it was toplink specific.
[/i]

That's exactly the sort of behaviour that I had suspected all along. But
never in my wildest visions did I imagine seeing this phenomenon between
two pieces of code using the same JPA layer [b]in the same process[/b] in
the same WAR.

I can try the Toplink-specific hints suggested by mayankmishra below,
but I'm still flummoxed that this isn't default JPA policy.
[Message sent by forum member 'pohl' (pohl)]

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