[Registry-dev] Transaction support in the embedded registry

Paul Fremantle paul at wso2.com
Wed Apr 2 01:53:10 PDT 2008


I thought we had been refactoring so that we had a separation between 
code that was standard across implementations and code that isn't. I'm 
not convinced that we want to rewrite transactions code across every 
backend when its going to be similar.

I'm also not convinced that we should be using our own transaction 
interfaces instead of working with the existing JTA model.

The other question we need to think about is whether anyone will ever 
need to interface the Registry into a wider 2-Phase Commit transaction - 
for example, will someone ever need to update some resources in the 
Registry AND update their own database in the same transaction. If the 
answer is no, then the approach below will work. If the answer is yes, 
then we should be using the standard JTA code which will do this for us. 
I don't know the answer! My gut feeling is that this is an unlikely 
scenario, but I think we should consider it before we go ahead.

Paul

Chathura C. Ekanayake wrote:
> Deepal Jayasinghe wrote:
>>
>>>
>>> I think it is much simpler for the users if you put the necessary 
>>> methods in the registry itself. They don't have to remember too many 
>>> APIs.
>>>
>>> e.g.
>>> registry.beginTx();
>>> try{
>>>     Resource res = registry.newResource();
>>>     registry.put("/test", resource);
>>>
>>>     Resource res2 = registry.newResource();
>>>     registry.put("/test2", res2);
>>>
>>>     registry.commit();
>>> } catch(Exception){
>>>        registry.rollback();
>>> }
>>>
>>> So it is very simple for embedders as you can see above.
>> But the problem is if someone try to write a new registry 
>> implementation (that is why we have make the registry an interface) 
>> then he has to handle that by himself.  IMO the transaction handling 
>> should be some above layer , not at the registry level. So I m +0 on 
>> this.
> 
> If some registry implementation does not support transactions, it can 
> throw UnsupportedOperationException for transaction related methods. 
> Registry interface specifies the transaction API, which standardize how 
> clients should use transactions. It is up to the registry impls to 
> decide to what extend they support the API.
> 
> Thanks,
> Chathura
> 
>>
>> Thank you!
>> Deepal
>>
>>
>>
>> _______________________________________________
>> Registry-dev mailing list
>> Registry-dev at wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>>
> 
> 
> _______________________________________________
> Registry-dev mailing list
> Registry-dev at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
> 

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

Office: +44 844 484 8143
Cell: +44 798 447 4618

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

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



More information about the Registry-dev mailing list