[Fwd: rdbms-1.0 user contribution]

Hakan Mattsson hakan@REDACTED
Thu Jan 14 15:44:03 CET 1999

On Thu, 14 Jan 1999, Ulf Wiger wrote:

Uffe> > But since you mentioned that you wanted a rollback hook, I assume that
Uffe> > its not only integrity constraints you are interested in. What whould you
Uffe> > use a rollback hook for? debugging? supervision? health diagnostics?
Uffe> The first use was this (I'm not saying it's a great idea):
Uffe> I allow the definition of read() write() and delete() hooks, which means
Uffe> that you can use mnesia:read(), write() and delete() on objects which do
Uffe> not correspond to mnesia tables - instead, the corresponding hook
Uffe> function is called instead. Obviously, these functions would have
Uffe> side-effects, so it's important to know whether the transaction succeeds
Uffe> or fails. For this purpose, I have written the functions
Uffe> register:commit_action/1 and register_rollback_action/1, which are
Uffe> called after commit or rollback.
Uffe> Naturally, the hook functions must be prepared to be called several
Uffe> times during one transaction, since the transaction may be restarted.

In my first implementation of the mnesia_access callback interface, I
had the notion of virtual transactions. With hooks for start,
verification, commit and abort of activities. Sorry Uffe. 


More information about the erlang-questions mailing list