-
1. Re: useLocalTx semantics
ataylor Nov 4, 2013 9:17 AM (in response to janssk77)setting localtx to true simply means the resource adapter will use a non xa jms tx and rollback or commit that on the jms session using a JMS transaction. It has no connection at all with JTA so you should use NotSupported if you dont have any other xa stuff going on.
-
2. Re: useLocalTx semantics
janssk77 Nov 4, 2013 10:11 AM (in response to ataylor)I was hoping the 'use-local-tx' flag would have semantics similar to the <transaction mode="local"/> setting of 'pooled-connection-factory'. When sending a JMS message, the latter flag registers a hornetq session as a non-xa (1-phase commit) resource with an ongoing JTA transaction. So local means 'non-xa' in this context.
I think there can be four different levels of 'transaction handling' for MDBs:no-tx,local-tx,non-xa,xa. Is it correct to say that only no-tx,local-tx and xa are supported today ?
In our usecase, i want to use a transacted MDB (everything that happens inside my 'onmessage' handler should be atomic),but i don't want the MDB hornetq session itself to join the XA session (mainly for performance reason, XA means extra IO for the tx logs).
-
3. Re: useLocalTx semantics
ataylor Nov 4, 2013 10:48 AM (in response to janssk77)I was hoping the 'use-local-tx' flag would have semantics similar to the <transaction mode="local"/> setting of 'pooled-connection-factory'. When sending a JMS message, the latter flag registers a hornetq session as a non-xa (1-phase commit) resource with an ongoing JTA transaction. So local means 'non-xa' in this context.
nope, like I say it just an internal flag for how we create and use a session in the RA.
I think there can be four different levels of 'transaction handling' for MDBs:no-tx,local-tx,non-xa,xa. Is it correct to say that only no-tx,local-tx and xa are supported today ?
Im not reeally sure what you mean here, supported by whom, surely non xa is just using NOT_SUPPORTED.
In our usecase, i want to use a transacted MDB (everything that happens inside my 'onmessage' handler should be atomic),but i don't want the MDB hornetq session itself to join the XA session (mainly for performance reason, XA means extra IO for the tx logs).
is there a big difference? also you do realise that you may get duplicate deliveries on server failure?
-
4. Re: useLocalTx semantics
janssk77 Nov 4, 2013 3:58 PM (in response to ataylor)By non-xa i mean the hornetq session would join the JTA transaction (started since the message is transacted) as a 'local' resource, not an XA-resource. I'm aware that it does not support 2PC and it does not offer the same 'robustness' as an XA resource, but it does scale a lot better. (XA transaction log a bottleneck since we have a lot of small messages in our system)
Anyway. At least I understand better how the current implementation works. I still think it's a bit weird that hornetq will 'silently' keep messages on the queue after they are handled if an MDB is transacted and the use_local_tx flag is set. If this is a wrong configuration, better make that clear by raising an exception.
Regards,
Koen