try { AbstractIscTrHandle tr = stmt.getTransaction(); if (tr != null) tr.unregisterStatementFromTransaction(stmt); } finally { stmt.unregisterTransaction(); }
	public void iscDsqlFreeStatement(IscStmtHandle stmt_handle, int option)			throws GDSException {		boolean debug = log != null && log.isDebugEnabled();		isc_stmt_handle_impl stmt = (isc_stmt_handle_impl) stmt_handle;		isc_db_handle_impl db = stmt.getRsr_rdb();		if (stmt_handle == null) {			throw new GDSException(ISCConstants.isc_bad_req_handle);		}		// Does not seem to be possible or necessary to close		// an execute procedure statement.		if (stmt.isSingletonResult() && option == ISCConstants.DSQL_close) {			return;		} // end of if ()		synchronized (db) {			try {				if (!db.isValid()) {					// too late, socket has been closed					return;				} // end of if ()				if (debug)					log.debug("op_free_statement ");				db.out.writeInt(op_free_statement);				db.out.writeInt(stmt.getRsr_id());				db.out.writeInt(option);				db.out.flush();				if (debug)					log.debug("sent");				receiveResponse(db, -1);				if (option == ISCConstants.DSQL_drop) {					stmt.setInSqlda(null);					stmt.setOutSqlda(null);					stmt.setRsr_rdb(null);				}				// those rows are used by cachedFetcher don't clear				stmt.clearRows();				/** @todo implement statement handle tracking correctly */				// db.rdb_sql_requests.remove(stmt);			} catch (IOException ex) {				throw new GDSException(ISCConstants.isc_net_read_err);			}		}	}