Hi,
when sending a message to 2 queue destinations (using the same session) I want
to rollback both sends when either of the 2 queues is down. To test this, I
issued a stop() (using MBean method) on queue A at points (1) and (2) in my
code (see below). The mpt.send(message) call doesn't fail, however when the
commit is executed, I get a SpyTransactionRolledBackException which is what I
would expect. It seems though that queue/testQueue did receive the message
regardless of the rollback.
Is this expected behaviour? If so, how can I make sure my scenario issues a
rollback on both queues?
Thanks,
Mario
| ctx = new InitialContext();
| cf = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
| Connection c = cf.createConnection();
| Session s = c.createSession(true, Session.SESSION_TRANSACTED);
|
| destination1 = (Queue)ctx.lookup("queue/testQueue");
| message = s.createTextMessage();
| message.setText("***mymessage**");
| MessageProducer mpq = s.createProducer(destination1);
| mpq.send(message);
|
| destination2 = (Queue)ctx.lookup("queue/A");
| //(1)
| MessageProducer mpt = s.createProducer(destination2);
| //(2)
| mpt.send(message);
|
| s.commit();
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3872124#3872124
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3872124
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user