[erlang-questions] How do Mnesia commits and rollbacks work?

Joel Reymont <>
Fri Jul 6 11:57:13 CEST 2007


Does anyone know the exact details of how Mnesia commits and rolls back?

Does it somehow figure out the locks, writes to temp tables and then  
commits the whole transaction once to the underlying ets and dets  

Does it write to ets and dets multiple times and knows how to roll  
back the changes?

The reason I ask is that if the underlying table is Amazon S3 or any  
other backend that has no roll back functionality then Mnesia may be  
writing each time a transaction fails and is restarted.

Imagine that I'm trying to give employees a raise and the transaction  
first fetches from the backend and then updates. Suppose I'm updating  
a group of employees in the same transaction.
I'm specially wary of the situation where half of the raises may go  
through to S3 and then would be repeated once the transaction fails.  
Multiple raises! Oh, /management/ horror!

	Thanks, Joel

http://topdog.cc      - EasyLanguage to C# compiler
http://wagerlabs.com  - Blog

More information about the erlang-questions mailing list