// Check to see if we're in a transaction
synchronized (lock) {
if (transaction != null) {
if (transaction.isCanceled()) {
return DefaultDbSessionFuture.createCompletedErrorFuture(
this, new DbException(this, "Could not execute request; transaction is in failed state"));
}
// Schedule starting transaction with database if possible
if (!transaction.isBeginScheduled()) {
// Set isolation level if necessary
enqueueStartTransaction(transaction);