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:
A. Abram White 2006-09-13 23:23:22 +00:00
parent cfcca49521
commit 913e54c93c
2 changed files with 3 additions and 10 deletions

View File

@ -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) {

View File

@ -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