*/
Connection conn = null;
PreparedStatement st = null;
ResultSet rs = null;
PreparedTxInfo txInfo = null;
TransactionWrapper wrap = new TransactionWrapper();
PreparedStatement exst = null;
ResultSet exrs = null;
Map<Long, Long> txTimes = new HashMap<Long, Long>();
try
{
List<PreparedTxInfo> transactions = new ArrayList<PreparedTxInfo>();
conn = getConnectionWithRetry();
if (supportsTxAge)
{
try
{
exst = conn.prepareStatement(getSQLStatement("SELECT_TRANSACTION_START_TIME_EXTRA"));
exrs = exst.executeQuery();
while (exrs.next())
{
long txId = exrs.getLong(1);
long txTime = exrs.getLong(2);
txTimes.put(txId, txTime);
}
}
finally
{
closeResultSet(exrs);
closeStatement(exst);
}
}
st = conn
.prepareStatement(getSQLStatement("SELECT_PREPARED_TRANSACTIONS"));
st.setInt(1, nodeID);
rs = st.executeQuery();
while (rs.next())
{
// get the existing tx id --MK START
long txId = rs.getLong(1);
byte[] branchQual = getVarBinaryColumn(rs, 2);
int formatId = rs.getInt(3);
byte[] globalTxId = getVarBinaryColumn(rs, 4);
Xid xid = new MessagingXid(branchQual, formatId, globalTxId);
// create a tx info object with the result set detailsdetails
txInfo = new PreparedTxInfo(txId, xid, txTimes.get(txId));
transactions.add(txInfo);
}
return transactions;