Forum: Ruby on Rails transactions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B192011964906cffb106241f99cb4c3f?d=identicon&s=25 Rodrigo Dominguez (rdominguez)
on 2006-06-07 17:08
(Received via mailing list)
I need information about transactions. I have checked the web but I
wasn't able to find anything useful about transactions. Can you give me
some links where transactions in rails are explained in deeper?
How could I know if a transaction failed?


Rodrigo Dominguez
 
Iplan Networks                Datos Personales
rdominguez@iplan.com.ar       rorra@rorra.com.ar
www.iplan.com.ar              www.rorra.com.ar
5031-6303                     15-5695-6027
A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (Guest)
on 2006-06-08 14:55
(Received via mailing list)
the rails api documentation for transactions, though short, really
explains
it quite well.

http://api.rubyonrails.org/classes/ActiveRecord/Tr...

typically you would use transactions within a begin/rescue block as an
exception will be raised if the transactions fails

being
  Model.transaction do
    # do your transaction stuff here
  end
rescue Exception => e
  # oh no, the transaction failed so nothing was committed!
end
This topic is locked and can not be replied to.