try { if (inTransaction()) { getLocalTransaction().rollback(); } } catch(javax.resource.ResourceException resex) { throw new FBSQLException(resex); } finally {  setAutoCommit(true); } }  mc.close(this); mc = null; } } finally { invalidate();
setAutoCommit(true); } }  mc.close(this); mc = null;
    public synchronized void close() throws SQLException {        try {            freeStatements();        } finally {                        try {                if (mc != null) {                    //if we are in a transaction started                     //automatically because autocommit = false, roll it back.                                        //leave managed transactions alone, they are normally                    //committed after the Connection handle is closed.                                        if (!getAutoCommit())                     {                        //autocommit is always true for managed tx.                        try {                            if (inTransaction())                            {                                getLocalTransaction().rollback();                            }                        } catch(javax.resource.ResourceException resex) {                            throw new FBSQLException(resex);                        }                        finally                        {                            //always reset Autocommit for the next user.                            setAutoCommit(true);                        }                    } // end of if ()                                        mc.close(this);                    mc = null;                }            } finally {                invalidate();            }        }    }