mirror of https://github.com/apache/openjpa.git
fix for re-proxying of hashed types during commit / rollback
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@443153 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9650a1a20b
commit
cfcca49521
|
@ -135,6 +135,7 @@ public class BrokerImpl
|
|||
private static final int FLAG_FLUSH_REQUIRED = 2 << 8;
|
||||
private static final int FLAG_REMOTE_LISTENER = 2 << 9;
|
||||
private static final int FLAG_RETAINED_CONN = 2 << 10;
|
||||
private static final int FLAG_TRANS_ENDING = 2 << 11;
|
||||
|
||||
private static final Localizer _loc =
|
||||
Localizer.forPackage(BrokerImpl.class);
|
||||
|
@ -1640,6 +1641,19 @@ public class BrokerImpl
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given transaction is ending, i.e. in the 2nd phase
|
||||
* of a commit or rollback
|
||||
*/
|
||||
boolean isTransactionEnding() {
|
||||
beginOperation(true);
|
||||
try {
|
||||
return (_flags & FLAG_TRANS_ENDING) != 0;
|
||||
} finally {
|
||||
endOperation();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean beginOperation(boolean syncTrans) {
|
||||
lock();
|
||||
try {
|
||||
|
@ -1722,6 +1736,7 @@ public class BrokerImpl
|
|||
try {
|
||||
assertActiveTransaction();
|
||||
|
||||
_flags |= FLAG_TRANS_ENDING;
|
||||
endTransaction(status);
|
||||
if (_sync != null)
|
||||
_sync.afterCompletion(status);
|
||||
|
@ -1746,6 +1761,7 @@ public class BrokerImpl
|
|||
} finally {
|
||||
_flags &= ~FLAG_ACTIVE;
|
||||
_flags &= ~FLAG_FLUSHED;
|
||||
_flags &= ~FLAG_TRANS_ENDING;
|
||||
|
||||
if (_transEventManager != null
|
||||
&& _transEventManager.hasEndListeners()) {
|
||||
|
|
|
@ -824,7 +824,8 @@ public class StateManagerImpl
|
|||
return;
|
||||
|
||||
boolean active = _broker.isActive();
|
||||
if (active) {
|
||||
boolean ending = _broker.isTransactionEnding();
|
||||
if (active && !ending) {
|
||||
if (_broker.getOptimistic())
|
||||
setPCState(_state.beforeOptimisticRead(this, field));
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue