On Friday 29 September 2006 05:36, Sam Donaldson wrote:> Hi,
>
> I''m a bit confused about Rails transactions. Are these Rails
> transactions:
>
> Model.transaction do
> ...
> end
>
> or does the above code actually start a database transaction?
The outermost of these blocks starts a database transaction. Leaving the
block normally will commit the transaction, leaving it with an
exception will rollback the transaction.
When transaction blocks are nested, in the same method or inside called
methods, the inner transaction blocks neither start nor end
transactions.
> If
> this starts a db transaction, what sort of db transaction does this
> start? I would not want serializable transactions as this would be
> expensive.
Rails just sends BEGIN/COMMIT/ROLLBACK to the database without an
isolation level. If you want any specific one, you have to set it by
other means.
Michael
--
Michael Schuerig
mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org
http://www.schuerig.de/michael/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---