[Registry-dev] Transaction support in the embedded registry

Chathura C. Ekanayake chathura at wso2.com
Wed Apr 2 01:48:43 PDT 2008


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
>




More information about the Registry-dev mailing list