long id = rs.getLong(1);
tid = new TransactionUID(id);
int type = rs.getInt(2);
int state = rs.getInt(3);
TransactionState txnState = (TransactionState)Util.readObject(rs, 4);
txnState.setState(state);
BrokerAddress txnHomeBroker = (BrokerAddress)Util.readObject(rs, 5);
TransactionBroker[] txnBrokers = (TransactionBroker[])Util.readObject(rs, 6);
long sessionID = rs.getLong(7);
// insert in new table
try {
pstmt.setLong( 1, id );
pstmt.setInt( 2, type );
pstmt.setInt( 3, state );
pstmt.setInt( 4, txnState.getType().intValue() );
JMQXid jmqXid = txnState.getXid();
if ( jmqXid != null ) {
pstmt.setString( 5, jmqXid.toString() );
} else {
pstmt.setNull( 5, Types.VARCHAR );
}
Util.setObject( pstmt, 6, txnState );
Util.setObject( pstmt, 7, txnHomeBroker );
Util.setObject( pstmt, 8, txnBrokers );
pstmt.setLong( 9, sessionID );
pstmt.setLong( 10, txnState.getExpirationTime() );
pstmt.setLong( 11, txnState.getLastAccessTime() );
if (dobatch) {
pstmt.addBatch();
} else {
pstmt.executeUpdate();