[Registry-dev] Transaction support in the embedded registry

Chathura C. Ekanayake chathura at wso2.com
Wed Apr 23 03:26:14 PDT 2008


I have completed the transactions support in the embedded registry. 
Transactions functionality can be accessed using the below API methods 
in the Registry interface.

void beginTransaction() throws RegistryException;

void commitTransaction() throws RegistryException;

void rollbackTransaction() throws RegistryException;

I have added a test case (org.wso2.registry.jdbc.TransactionsTest) to 
demonstrate the use of transaction APIs.

Thanks,
Chathura

Chathura C. Ekanayake wrote:
>
> I am implementing the transaction support in the embedded registry 
> layer. I have introduced below four methods to the Registry API to 
> handle transactions. These methods can be used by client application 
> in a similar way to JDBC connection transactions.
>
> registry.beginTransaction();
>
> registry.commit();
>
> registry.rollback();
>
> registry.endTransaction();
>
> When beginTransaction() is called, a database connection is obtained 
> and stored in a thread local variable. Then all other database related 
> registry components use that connection by calling:
>
> Connection conn = Transaction.getConnection();
>
> When a transaction is started, connections are not commited unless 
> registry.commit() is called. Therefore, client application can perform 
> sequence of operations in a single transaction by listing them within 
> registry.beginTransaction() and registry.commit(). Once the 
> transaction is complete client applications should call 
> registry.endTransaction(), so that the connection is closed and the 
> thread local variable is cleared.
>
> Thanks,
> Chathura
>
>
>
>
> _______________________________________________
> 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