Transactions


#1

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 D.

Iplan Networks Datos Personales
removed_email_address@domain.invalid removed_email_address@domain.invalid
www.iplan.com.ar www.rorra.com.ar
5031-6303 15-5695-6027


#2

the rails api documentation for transactions, though short, really
explains
it quite well.

http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html#M000585

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