Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Arnesttransacts

Arnesttransacts

ActiveRecord by default disables nested transactions (i.e if a transaction is active, further requests to open transaction are just ignored).

This plugin replaces ActiveRecord::ConnectionAdapters::DatabaseStatements#transaction method to make usage of SAVEPOINT technology, which effectively enables nested transactions.

The idea is that if no transaction is currently opened, open one, else create savepoint instead. On transaction end release this savepoint or commit transaction if this was last transaction. When something bad happens a transaction is rolled back to most recent savepoint or to the beginning.

Currently supported databases: - PostgreSQL - MySQL (not tested at all, but should use same syntax as PostgreSQL)

USAGE

Just install this plugin in $RAILS_ROOT/vendor/plugins directory and everything should work right out of the box.

TODO

- maybe include some switch to toggle nested transaction support - implement savepoints for the rest of DBMS’s which support it

BUGS & FEEDBACK

All comments, bugreports and patches are welcome. Send them to laas.toom@eenet.ee or use Bug Tracker at http://rubyforge.org/projects/arnesttransacts/

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'