public void testSendAndReceiveFailAfterPrepareAndRetryCommit() throws Exception
{
XAConnection xaConn1 = null;
XAConnectionFactory xaCF = (XAConnectionFactory)cf;
TextMessage sent1 = null;
// Sending a messages
{
Connection conn1 = null;
conn1 = cf.createConnection();
assertEquals(0, ((JBossConnection)conn1).getServerID());
conn1 = cf.createConnection();
assertEquals(1, ((JBossConnection)conn1).getServerID());
//Send a message
Session sess = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer prod = sess.createProducer(queue[1]);
sent1 = sess.createTextMessage("plop1");
prod.send(sent1);
conn1.close();
}
try
{
xaConn1 = xaCF.createXAConnection();
assertEquals(0, ((JBossConnection)xaConn1).getServerID());
xaConn1 = xaCF.createXAConnection();
assertEquals(1, ((JBossConnection)xaConn1).getServerID());
xaConn1.start();