if (managedConnection) {
if (managedConnection && mc.inTransaction()) {
    public void setManagedEnvironment(boolean managedConnection) throws SQLException {        checkValidity();                InternalTransactionCoordinator.AbstractTransactionCoordinator coordinator;                if (managedConnection) {            coordinator = new InternalTransactionCoordinator.ManagedTransactionCoordinator(this);            this.autoCommit = false;        } else {            coordinator = new InternalTransactionCoordinator.AutoCommitCoordinator(this, localTransaction);            this.autoCommit = true;        }                 txCoordinator.setCoordinator(coordinator);    }