[Registry-dev] Transaction support in the embedded registry

Chathura C. Ekanayake chathura at wso2.com
Tue Apr 1 21:49:28 PDT 2008


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






More information about the Registry-dev mailing list