openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r666515 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ProjectionResultObjectProvider.java openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Date Wed, 11 Jun 2008 03:33:36 GMT
Author: ppoddar
Date: Tue Jun 10 20:33:35 2008
New Revision: 666515

URL: http://svn.apache.org/viewvc?rev=666515&view=rev
Log:
OPENJPA-209: Detect identical instances being added to L1 cache multiple times during a load
session.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ProjectionResultObjectProvider.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ProjectionResultObjectProvider.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ProjectionResultObjectProvider.java?rev=666515&r1=666514&r2=666515&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ProjectionResultObjectProvider.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ProjectionResultObjectProvider.java
Tue Jun 10 20:33:35 2008
@@ -70,6 +70,8 @@
     public Object getResultObject()
         throws Exception {
         Result res = getResult();
+        // for a projection, Result has no base mapping
+        res.setBaseMapping(null);
         int idx = res.indexOf();
         Object[] arr = new Object[_exps[idx].projections.length];
         for (int i = 0; i < _exps[idx].projections.length; i++)

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=666515&r1=666514&r2=666515&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Tue Jun 10 20:33:35 2008
@@ -311,7 +311,9 @@
 
         // initialize our state and add ourselves to the broker's cache
         setPCState(state);
-        _broker.setStateManager(_id, this, BrokerImpl.STATUS_INIT);
+        if (_broker.getStateManagerImplById(getObjectId(), false) == null) {
+        	_broker.setStateManager(_id, this, BrokerImpl.STATUS_INIT);
+        }
         if (state == PCState.PNEW)
             fireLifecycleEvent(LifecycleEvent.AFTER_PERSIST);
 



Mime
View raw message