Manuel Lemos | 16 Feb 2008 02:48
Picon
Favicon

Nested component transactions

Hello,

I have not made many Metastorage releases recently but I made some
developments in Metabase that provide flexibility to Metastorage
generated components.

Some applications may need to use classes of multiple components at the
same time, like for instance a blog component may use a forum component
to implement blog comments.

However, if both components start transactions, previously Metabase
would fail complaining that a transaction was already started when the
second component starts the transaction.

In the latest revision of Metastorage, nested transactions are allowed.
This means that when the second component starts a transaction, nothing
happens, the transaction started by the first continues.

When the second component ends a transaction, with either a commit or a
rollback implemented by a factory function of type finishtransaction,
nothing happens either. The transaction is only ended when the outer
component finishes the transaction.

Note that if an inner component requests to end a transaction by
commiting it, the outer component must also do the same consistently,
ie. request to commit the transaction. Likewise, if the inner component
request to rollback the transaction, the outer component must also
rollback the transaction.

Otherwise, Metabase will fail with an error and the transaction is
(Continue reading)


Gmane