You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by Irantha <ir...@wso2.com> on 2008/12/01 10:41:17 UTC

Re: Sandesha2 JTA transactions

Hi Paul,

Sandesha2 Transaction is used to make consistent changes to the data store.  Changing it from a JDBC local transaction to JTA transaction will
 make implementation complex and require to use a JTA aware data source for Sandesha2 persistence. 
A Simpler solution would be to differ Acknowledgments until JTA transaction commits. We can use javax.transaction.Synchronization.AfterCompletion() 
event to hook in acknowledgments. Sending side redelivery policy will take care of retrying aborted transactions.

WDYT?

Thanks,
Irantha



Paul Fremantle wrote:
> Irantha
>
> Sandesha2 already has a plug point for transactions. Please see:
>
> URL: https://svn.apache.org/repos/asf/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/Transaction.java
>
> And the implementations of that.
>
> Paul
>
> On Fri, Nov 28, 2008 at 9:08 AM, Irantha <ir...@wso2.com> wrote:
>   
>> OMHO It would be useful to have Sandesha2 capable of sending and receiving
>> ws-rm messages within a JTA transaction (similar to how JMS implementations
>> support JTA transactions).
>>
>> On the sending side sandesha2 should look for an existing JTA transactions
>> and participate on that transaction if one exists.
>> On the receiving side need a parameter (in module.xml) that  specify whether
>> to start a new JTA transaction on message receive. If that parameter is
>> specified then should start a new JTA transaction for each message receive.
>>
>> What do you think?
>>
>> -Irantha
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>>
>>
>>     
>
>
>
>   


Re: Sandesha2 JTA transactions

Posted by Amila Suriarachchi <am...@gmail.com>.
On 12/1/08, Irantha <ir...@wso2.com> wrote:
> Hi Paul,
>
> Sandesha2 Transaction is used to make consistent changes to the data store.
> Changing it from a JDBC local transaction to JTA transaction will
>  make implementation complex and require to use a JTA aware data source for
> Sandesha2 persistence.
I am not aware of the complexity of doing this but I think better way
is to do like this. Please see the below comment.

> A Simpler solution would be to differ Acknowledgments until JTA transaction
> commits. We can use javax.transaction.Synchronization.AfterCompletion()
> event to hook in acknowledgments. Sending side redelivery policy will take
> care of retrying aborted transactions.

I found this Research paper[1] which discuss this problem. I think
here the idea is to implementing the Queued Transaction processing
model to guarantee the application to application reliability.
As I see you are suggesting a method similar to Direct Transaction Processing.

thanks,
Amila.


[1]http://www.research.ibm.com/AEM/pubs/wes2003final.pdf

>
> WDYT?
>
> Thanks,
> Irantha
>
>
>
> Paul Fremantle wrote:
>> Irantha
>>
>> Sandesha2 already has a plug point for transactions. Please see:
>>
>> URL:
>> https://svn.apache.org/repos/asf/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/Transaction.java
>>
>> And the implementations of that.
>>
>> Paul
>>
>> On Fri, Nov 28, 2008 at 9:08 AM, Irantha <ir...@wso2.com> wrote:
>>
>>> OMHO It would be useful to have Sandesha2 capable of sending and
>>> receiving
>>> ws-rm messages within a JTA transaction (similar to how JMS
>>> implementations
>>> support JTA transactions).
>>>
>>> On the sending side sandesha2 should look for an existing JTA
>>> transactions
>>> and participate on that transaction if one exists.
>>> On the receiving side need a parameter (in module.xml) that  specify
>>> whether
>>> to start a new JTA transaction on message receive. If that parameter is
>>> specified then should start a new JTA transaction for each message
>>> receive.
>>>
>>> What do you think?
>>>
>>> -Irantha
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>>>
>>>
>>>
>>
>>
>>
>>
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Re: Sandesha2 JTA transactions

Posted by Paul Fremantle <pz...@gmail.com>.
Irantha

On the face of it your approach is tempting. However, the transaction
from the persistent store to acknowledge is actually not the hard
part. You don't even need to use the AfterCompletion(). You simply
need to have the ack driven off the database rather than the inflow
logic.

The real problem is that there is no point in having a transactional
ack if the data then gets lost between the persistent store and the
application. And the only way of getting that to work is using JTA.
You have no control over what databases, JMS queues or other
transactional systems the application can call, so the only way to
ensure transactional delivery of the message is to use JTA for the
persistent store.

Paul

On Mon, Dec 1, 2008 at 9:41 AM, Irantha <ir...@wso2.com> wrote:
> Hi Paul,
>
> Sandesha2 Transaction is used to make consistent changes to the data store.
> Changing it from a JDBC local transaction to JTA transaction will
>  make implementation complex and require to use a JTA aware data source for
> Sandesha2 persistence.
> A Simpler solution would be to differ Acknowledgments until JTA transaction
> commits. We can use javax.transaction.Synchronization.AfterCompletion()
> event to hook in acknowledgments. Sending side redelivery policy will take
> care of retrying aborted transactions.
>
> WDYT?
>
> Thanks,
> Irantha
>
>
> Paul Fremantle wrote:
>
> Irantha
>
> Sandesha2 already has a plug point for transactions. Please see:
>
> URL:
> https://svn.apache.org/repos/asf/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/Transaction.java
>
> And the implementations of that.
>
> Paul
>
> On Fri, Nov 28, 2008 at 9:08 AM, Irantha <ir...@wso2.com> wrote:
>
>
> OMHO It would be useful to have Sandesha2 capable of sending and receiving
> ws-rm messages within a JTA transaction (similar to how JMS implementations
> support JTA transactions).
>
> On the sending side sandesha2 should look for an existing JTA transactions
> and participate on that transaction if one exists.
> On the receiving side need a parameter (in module.xml) that  specify whether
> to start a new JTA transaction on message receive. If that parameter is
> specified then should start a new JTA transaction for each message receive.
>
> What do you think?
>
> -Irantha
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: sandesha-dev-help@ws.apache.org
>
>
>
>
>
>



-- 
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org