OPENJPA-209: Detect identical instances being added to L1 cache multiple times during a load session.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@666515 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2008-06-11 03:33:35 +00:00
parent d965db7271
commit f1ac625b2c
2 changed files with 5 additions and 1 deletions

View File

@ -70,6 +70,8 @@ class ProjectionResultObjectProvider
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++)

View File

@ -311,7 +311,9 @@ public class StateManagerImpl
// 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);