class ConnectionProxy extends ConnectionWrapper {
    private final boolean inTrans;

    public ConnectionProxy(Connection real) {
        super(real);
        inTrans = TranUtils.inTrans();
    }

    @Override
    public void commit() throws SQLException {
        if (inTrans == false && super.getAutoCommit() == false) {
            super.commit();
        }
    }

    @Override
    public void rollback() throws SQLException {<FILL_FUNCTION_BODY>}

    @Override
    public void close() throws SQLException {
        if (inTrans == false) {
            super.close();
        }
    }
}

        if (inTrans == false && super.getAutoCommit() == false) {
            super.rollback();
        }
    
<methods>public void <init>(java.sql.Connection) ,public void abort(java.util.concurrent.Executor) throws java.sql.SQLException,public void clearWarnings() throws java.sql.SQLException,public void close() throws java.sql.SQLException,public void commit() throws java.sql.SQLException,public java.sql.Array createArrayOf(java.lang.String, java.lang.Object[]) throws java.sql.SQLException,public java.sql.Blob createBlob() throws java.sql.SQLException,public java.sql.Clob createClob() throws java.sql.SQLException,public java.sql.NClob createNClob() throws java.sql.SQLException,public java.sql.SQLXML createSQLXML() throws java.sql.SQLException,public java.sql.Statement createStatement() throws java.sql.SQLException,public java.sql.Statement createStatement(int, int) throws java.sql.SQLException,public java.sql.Statement createStatement(int, int, int) throws java.sql.SQLException,public java.sql.Struct createStruct(java.lang.String, java.lang.Object[]) throws java.sql.SQLException,public boolean getAutoCommit() throws java.sql.SQLException,public java.lang.String getCatalog() throws java.sql.SQLException,public java.lang.String getClientInfo(java.lang.String) throws java.sql.SQLException,public java.util.Properties getClientInfo() throws java.sql.SQLException,public int getHoldability() throws java.sql.SQLException,public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException,public int getNetworkTimeout() throws java.sql.SQLException,public java.sql.Connection getReal() ,public java.lang.String getSchema() throws java.sql.SQLException,public int getTransactionIsolation() throws java.sql.SQLException,public Map<java.lang.String,Class<?>> getTypeMap() throws java.sql.SQLException,public java.sql.SQLWarning getWarnings() throws java.sql.SQLException,public boolean isClosed() throws java.sql.SQLException,public boolean isReadOnly() throws java.sql.SQLException,public boolean isValid(int) throws java.sql.SQLException,public boolean isWrapperFor(Class<?>) throws java.sql.SQLException,public java.lang.String nativeSQL(java.lang.String) throws java.sql.SQLException,public java.sql.CallableStatement prepareCall(java.lang.String) throws java.sql.SQLException,public java.sql.CallableStatement prepareCall(java.lang.String, int, int) throws java.sql.SQLException,public java.sql.CallableStatement prepareCall(java.lang.String, int, int, int) throws java.sql.SQLException,public java.sql.PreparedStatement prepareStatement(java.lang.String) throws java.sql.SQLException,public java.sql.PreparedStatement prepareStatement(java.lang.String, int, int) throws java.sql.SQLException,public java.sql.PreparedStatement prepareStatement(java.lang.String, int, int, int) throws java.sql.SQLException,public java.sql.PreparedStatement prepareStatement(java.lang.String, int) throws java.sql.SQLException,public java.sql.PreparedStatement prepareStatement(java.lang.String, int[]) throws java.sql.SQLException,public java.sql.PreparedStatement prepareStatement(java.lang.String, java.lang.String[]) throws java.sql.SQLException,public void releaseSavepoint(java.sql.Savepoint) throws java.sql.SQLException,public void rollback() throws java.sql.SQLException,public void rollback(java.sql.Savepoint) throws java.sql.SQLException,public void setAutoCommit(boolean) throws java.sql.SQLException,public void setCatalog(java.lang.String) throws java.sql.SQLException,public void setClientInfo(java.lang.String, java.lang.String) throws java.sql.SQLClientInfoException,public void setClientInfo(java.util.Properties) throws java.sql.SQLClientInfoException,public void setHoldability(int) throws java.sql.SQLException,public void setNetworkTimeout(java.util.concurrent.Executor, int) throws java.sql.SQLException,public void setReadOnly(boolean) throws java.sql.SQLException,public java.sql.Savepoint setSavepoint() throws java.sql.SQLException,public java.sql.Savepoint setSavepoint(java.lang.String) throws java.sql.SQLException,public void setSchema(java.lang.String) throws java.sql.SQLException,public void setTransactionIsolation(int) throws java.sql.SQLException,public void setTypeMap(Map<java.lang.String,Class<?>>) throws java.sql.SQLException,public T unwrap(Class<T>) throws java.sql.SQLException<variables>private final non-sealed java.sql.Connection real