db.out.writeInt(8); db.out.writeLong(transactionId);
byte[] buf = new byte[4]; for (int i = 0; i < 4; i++){ buf[i] = (byte)(transactionId >>> (i * 8)); } db.out.writeBuffer(buf);
    public void iscReconnectTransaction(IscTrHandle tr_handle,            IscDbHandle db_handle,            long transactionId) throws GDSException {        boolean debug = log != null && log.isDebugEnabled();        isc_tr_handle_impl tr = (isc_tr_handle_impl) tr_handle;        isc_db_handle_impl db = (isc_db_handle_impl) db_handle;        if (tr_handle == null)             throw new GDSException(ISCConstants.isc_bad_trans_handle);         if (db_handle == null)             throw new GDSException(ISCConstants.isc_bad_db_handle);                 synchronized (db) {            if (tr.getState() != AbstractIscTrHandle.NOTRANSACTION)                 throw new GDSException(ISCConstants.isc_tra_state);                         tr.setState(AbstractIscTrHandle.TRANSACTIONSTARTING);            try {                if (debug) log.debug("op_transaction ");                db.out.writeInt(op_reconnect);                                // TODO check if sending db handle is needed, most likely not                db.out.writeInt(db.getRdb_id());                db.out.writeInt(8);                db.out.writeLong(transactionId);                db.out.flush();                if (debug) log.debug("sent");                // out.flush();                receiveResponse(db, -1);            } catch (IOException ex) {                throw new GDSException(ISCConstants.isc_network_error);            }            tr.setTransactionId(db.getResp_object());            //tr.rtr_rdb = db;            tr.setDbHandle(db);            tr.setState(AbstractIscTrHandle.TRANSACTIONSTARTED);            //db.rdb_transactions.addElement(tr);        }//end synch on db    }