Atomikos Forum

Question-MessageDriverContainer->rollback if no Message received

Hi.

The MessageDriverContainer does rollback the transaction if no message was received.

Springs Container does commit the transaction if no message is received.
Doing so will result in PREPARE and XA_RDONLY from ActiveMQ.

Why Atomikos Container does the rollback? It could commit the Tx too, couldn't it?
Doing a rollback will result in the transaction being marked rollback only and the complete JTA Tx gets rollbacked.
But not receiving a message on the container is not a "fault" to me, isn't it?

Changing the receiverThread Code to this:

....
else if (Thread.currentThread() == current && msg == null) {
                          Configuration
                                        .logDebug ( "MessageConsumerSession: Did not receive a message.");
                            } else {
                              commit = false;
                            }

does result in spring like behaviour and does not let my tx rollback.

The Container hat its own default timeout too - couldn't it use the Timeout specified for the transaction itself (beside setting another value on the container)?


thx for feedback about this :).
Torsten Krah Send private email
Wednesday, April 07, 2010
 
 
Torsten,

Rollback is usually cheaper than commit - that is why we rollback if no message was received.

HTH
Guy Pardon Send private email
Thursday, April 08, 2010
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics