[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ExternalTransaction.getStatus()
I'm using external transactions and need to check their status.
Before the transaction is started with 'begin' the method
'getStatus' returns the correct value ExternalTransaction.STATUS_NONE.
After starting the transaction (using 'begin') every call to
'getStatus' throws a NullPointerException in ExternalDatabase at
line 351:
/**
* Obtain the _internal_ server status of this transaction.
* @return Status of the transaction. Defined in
* {@link org.ozoneDB.core.Transaction}.<p>
*
* This method is never directly called from the client code.
*/
public final int getStatusTX( AbstractTransaction tx ) throws
TransactionExc, IOException {
if (tx.connection == null) {
return Transaction.STATUS_NONE;
}
else {
DbTransaction command = new DbTransaction(
DbTransaction.MODE_STATUS );
commandTX( tx, command );
>>>>> HERE: return ((Integer)command.result).intValue();
}
}
After some testing I changed the method to:
public final int getStatusTX( AbstractTransaction tx ) throws
TransactionExc, IOException {
if (tx.connection == null) {
return Transaction.STATUS_NONE;
}
else {
DbTransaction command = new DbTransaction(
DbTransaction.MODE_STATUS );
return ((Integer)commandTX( tx, command )).intValue();
// return ((Integer)command.result).intValue();
}
}
This seems to work fine, but does someone know if this code is
still correct?
Thanx,
Wolfgang
----------------------------------------------------------------------
Post a message: mailto:ozone-users@ozone-db.org
Unsubscribe: mailto:ozone-users-request@ozone-db.org?body=unsubscribe
Contact administrator: mailto:ozone-users-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/
----------------------------------------------------------------------