openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Krier (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-1899) Evict from L2 of a object causes secondary objects to never be loaded in graph
Date Mon, 29 Nov 2010 17:31:12 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robert Krier updated OPENJPA-1899:
----------------------------------

    Attachment: evictproblem.zip

Instructions:

Unzip the attached file.  In the conf directory, there is a file called schema_mysql.sql.
 
1) Create a new MySQL database and install the tables in the script.  
2) Edit conf/openjpa.properties and set the openjpa.ConnectionProperties to your database.
 
3) In the shell script and/or cmd files in the bin directory, change JAVA_HOME as appropriate
for your environment.
4) Run bin/simple-evict-sjvm-1.0 and bin/simple-evict-sjvm-2.0.  You will see there is no
problem under OpenJPA 1.0 but there is a problem 2.0.

You can also deploy the application on two nodes and run the two node tests on each node.
 There are instructions given in each script on how to configure.  Basically you just need
to edit the RemoteCommitProvider settings as appropriate on each node and run the tests on
each node and follow the prompts given in the application.

Note: I removed openjpa-all-2.0.1.jar from the lib/openjpa2.0.1 in order to keep the size
of this upload small enough to attach.

Bob

> Evict from L2 of a object causes secondary objects to never be loaded in graph
> ------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1899
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1899
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.0.0, 2.0.1
>         Environment: N/A
>            Reporter: Robert Krier
>            Priority: Blocker
>         Attachments: evictproblem.zip
>
>
> I have a simple example.  A customer has a reference to an address and a (primary) contact
(an extension of person).  Find the customer, get the contact and evict it from L2.  Now find
the customer again using a new entity manager.  Begin a Tx and change the address of the contact
and then call Customer.getPrimaryContact() (this is important)   Rollback the Tx.  Now find
the customer again using another new EntityManager and call Customer.getPrimaryContact().getAddress().
 The address associated with the contact is Null and not the original address as expected.
 The same scenario works fine under OpenJPA 1.2.2.  
> The reason this is a big problem for us is we use L2 caching in our application and the
application is clustered.  The same problem occurs if different nodes in the cluster operate
on the same objects.  In a cluster "evict" is not directly called, but the RemoteCommitProvider
will evict the L2 and create the same problem.  
> I have attached example code to reproduce the problem using a single JVM and calling
Evict.  I also have another example where you can deploy the code on two nodes in a cluster
and see the problem occurs that way as well.  Each example contains Unix shell scripts and
Windows cmd files as well.  Each are paired for JPA 1.0 and JPA 2.0.  Again, the problem only
occurs under JPA 2.0.
> This is a block for us.  We cannot ship our product with this type of problem as it means
objects and their graph can be corrupted.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message