persistence@glassfish.java.net

RE: I think I found a bug

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Tue, 12 Feb 2008 15:20:25 -0500

This is not a bug. What you are seeing is TopLink accessing the shared cache for the instance data instead of retreiving the data from the database. In general a locking policy and refreshing can handle any background database updates. If your data is somewhat volitile then you may want to configure the TopLink cache to have weak references by setting the Persistence Unit Property "toplink.cache.type.(default|<class>)" to "Weak". If you have extreamly volotile data you may want to disable caching by setting the PU property "toplink.cache.shared.(default|<class>)" to "false". Please note that CacheType.None is not what you are looking for it as it is a special case configuration that will result in StackOverFlows in most models.

--Gordon

-----Original Message-----
From: Sergio Samayoa [mailto:sergiosamayoa_at_icon.com.gt]
Sent: Tuesday, February 12, 2008 3:06 PM
To: persistence_at_glassfish.dev.java.net
Subject: I think I found a bug
Importance: High


Hi.

I'm experimenting with toplink with desktop applications and I think I found
a bug.

Top link doesn't sees the changes make by other applications.

This is the scenario:

1. TopLink application ("TLA" from here) starts and fetch some entities.
2. Another application ("OA" from here) access the same database and updates
one record then commits.
3. TLA's clears its persistence context (EntityManager.clear()) then fetches
again the records. The updated record stills as if weren't updated.

I'm pretty sure that the record is updated in the database but top link is
using existing entity instance without updating with the new data.

My environment:

Top Link 2.0-58g
JDK 1.6.0_03
Windows XP SP2

At this moment this bug is a stopper for multi-user desktop applications.

Where can I report it?

Regards.