/*
* Now we know (a) the transaction itself is alive, and (b) some
* lease still cares. Make sure it's still active as far as the
* it knows, and if it is, then ask the manager about it.
*/
ServerTransaction tr;
try {
/* This may fix a broken Txn, if it does it won't get moved
* from the broken to the unbroken list. It will get
* moved eventually, but it does seem unfortunate it does
* not happen immediately
*/
tr = txn.getTransaction(
monitor.space().getRecoveredTransactionManagerPreparer());
} catch (RemoteException e) {
final int cat = ThrowableConstants.retryable(e);
if (cat == ThrowableConstants.BAD_INVOCATION ||
cat == ThrowableConstants.BAD_OBJECT)
{
// Not likely to get better, give up
logUnpackingFailure("definite exception", Level.INFO,
true, e);
return true;
} else if (cat == ThrowableConstants.INDEFINITE) {
// try, try, again
logUnpackingFailure("indefinite exception", Levels.FAILED,
false, e);
mustQuery = true;
return false;
} else if (cat == ThrowableConstants.UNCATEGORIZED) {
// Same as above but log differently.
mustQuery = true;
logUnpackingFailure("uncategorized exception", Level.INFO,
false, e);
return false;
} else {
logger.log(Level.WARNING, "ThrowableConstants.retryable " +
"returned out of range value, " + cat,
new AssertionError(e));
return false;
}
} catch (IOException e) {
// Not likely to get better
logUnpackingFailure("IOException", Level.INFO, true, e);
return true;
} catch (RuntimeException e) {
// Not likely to get better
logUnpackingFailure("RuntimeException", Level.INFO, true, e);
return true;
} catch (ClassNotFoundException e) {
// codebase probably down, keep trying
logUnpackingFailure("ClassNotFoundException", Levels.FAILED,
false, e);
mustQuery = true;
return false;
}
if (logger.isLoggable(Level.FINEST))
logger.log(Level.FINEST, "{0} tr = {1}", new Object[]{this, tr});
int trState;
try {
trState = tr.getState();
} catch (TransactionException e) {
if (logger.isLoggable(Level.INFO))
logger.log(Level.INFO, "Got TransactionException when " +
"calling getState on " + tr + ", dropping transaction " +
tr.id, e);