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
|
||||
*/
|
||||
boolean isTransactionEnding() {
|
||||
beginOperation(true);
|
||||
try {
|
||||
return (_flags & FLAG_TRANS_ENDING) != 0;
|
||||
} finally {
|
||||
endOperation();
|
||||
}
|
||||
return (_flags & FLAG_TRANS_ENDING) != 0;
|
||||
}
|
||||
|
||||
public boolean beginOperation(boolean syncTrans) {
|
||||
|
|
|
@ -823,9 +823,7 @@ public class StateManagerImpl
|
|||
if (field != -1 && _meta.getField(field).isPrimaryKey())
|
||||
return;
|
||||
|
||||
boolean active = _broker.isActive();
|
||||
boolean ending = _broker.isTransactionEnding();
|
||||
if (active && !ending) {
|
||||
if (_broker.isActive() && !_broker.isTransactionEnding()) {
|
||||
if (_broker.getOptimistic())
|
||||
setPCState(_state.beforeOptimisticRead(this, field));
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue