If Synapse invokes the sender on the thread on which the transaction is running (and if the JMS connection factories are set up correctly), then it should automatically participate in this transaction. What kind of issue are you seeing with the current implementation of the JMS sender?
Andreas On Tue, Jan 5, 2010 at 12:10, Rajika Kumarasiri <raj...@wso2.com> wrote: > Yes, > The transaction should be initialized by synapse ( and I fixed the > transaction mediator to do that) and JMS transport(Sender) should > participate in that distributed transaction. > > Rajika > > On Tue, Jan 5, 2010 at 4:34 PM, Andreas Veithen > <andreas.veit...@gmail.com>wrote: > >> Rajika, >> >> That is a valid requirement, but in that case, it is not the >> responsibility of the JMS sender to create the transaction. >> >> Andreas >> >> On Tue, Jan 5, 2010 at 11:56, Rajika Kumarasiri <raj...@wso2.com> wrote: >> > Andreas, >> > I think I was not clear with my requirement. Consider a scenario like >> this. >> > Assume we use synapse and say we pick a message from a database and send >> it >> > to a JMS queue, using the JMS transport. Now I want this happen to be >> > happened in a distributed transaction, i.e. if something went wrong >> > (database crash or JMS queue crash) I want to rollback the transaction so >> > that I don't loose any messages. >> > >> > Rajika >> > >> > On Tue, Jan 5, 2010 at 4:10 PM, Andreas Veithen >> > <andreas.veit...@gmail.com>wrote: >> > >> >> Rajika, >> >> >> >> In that case, why do you need a distributed transaction, considering >> >> that the JMS sender uses a single resource (the JMS connection >> >> factory) and executes a single operation (sending the JMS message)? It >> >> seems to me that in that case, you don't need a transaction, and even >> >> less a distributed transaction. >> >> >> >> Andreas >> >> >> >> On Tue, Jan 5, 2010 at 11:33, Rajika Kumarasiri <raj...@wso2.com> >> wrote: >> >> > On Tue, Jan 5, 2010 at 3:20 PM, Andreas Veithen >> >> > <andreas.veit...@gmail.com>wrote: >> >> > >> >> >> Rajika, >> >> >> >> >> >> Why would the JMS sender ever want to create a new transaction? >> >> >> >> >> > >> >> > In case of only the JMS TransportSender needs to participate in a >> >> > distributed transaction. >> >> > >> >> > Rajika >> >> > >> >> > >> >> >> >> >> >> Andreas >> >> >> >> >> >> >> >> > >> >> >> > >> >