mirror of https://github.com/apache/openjpa.git
No need to beginOperation (and especially sync with trans) in
internal isTransactionEnding method. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@443164 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cfcca49521
commit
913e54c93c
|
@ -1642,16 +1642,11 @@ public class BrokerImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether the given transaction is ending, i.e. in the 2nd phase
|
* Return whether the current transaction is ending, i.e. in the 2nd phase
|
||||||
* of a commit or rollback
|
* of a commit or rollback
|
||||||
*/
|
*/
|
||||||
boolean isTransactionEnding() {
|
boolean isTransactionEnding() {
|
||||||
beginOperation(true);
|
return (_flags & FLAG_TRANS_ENDING) != 0;
|
||||||
try {
|
|
||||||
return (_flags & FLAG_TRANS_ENDING) != 0;
|
|
||||||
} finally {
|
|
||||||
endOperation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean beginOperation(boolean syncTrans) {
|
public boolean beginOperation(boolean syncTrans) {
|
||||||
|
|
|
@ -823,9 +823,7 @@ public class StateManagerImpl
|
||||||
if (field != -1 && _meta.getField(field).isPrimaryKey())
|
if (field != -1 && _meta.getField(field).isPrimaryKey())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean active = _broker.isActive();
|
if (_broker.isActive() && !_broker.isTransactionEnding()) {
|
||||||
boolean ending = _broker.isTransactionEnding();
|
|
||||||
if (active && !ending) {
|
|
||||||
if (_broker.getOptimistic())
|
if (_broker.getOptimistic())
|
||||||
setPCState(_state.beforeOptimisticRead(this, field));
|
setPCState(_state.beforeOptimisticRead(this, field));
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue