Can you give me some links where transactions in rails are explained in depth? Thank you PS: I''ve looked in google, but I just couldn''t find good articles, I''m working with postgresql Rodrigo Dominguez Iplan Networks Datos Personales rdominguez@iplan.com.ar rorra@rorra.com.ar www.iplan.com.ar <http://www.iplan.com.ar/> www.rorra.com.ar <http://www.rorra.com.ar/> 5031-6303 15-5695-6027 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060605/f872645e/attachment-0001.html
I''m interested to learn more about how to handle transactions as well. It seems that there are no transaction handling facilities at the controller level. Is this true? Should transactions all be handled at the model level? What if you have a form that create three different objects at once, but you want all three objects created as a unit of work? On 6/5/06, Rodrigo Dominguez <rails@rorra.com.ar> wrote:> > Can you give me some links where transactions in rails are explained in > depth? Thank you > > > > PS: I''ve looked in google, but I just couldn''t find good articles, I''m > working with postgresql > > > > > > 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 > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060605/3c21638b/attachment-0001.html
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
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 On 6/7/06, Rodrigo Dominguez <rails@rorra.com.ar> wrote:> > 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 > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060608/9bd7558e/attachment.html
I''m curious about this as well. I''m guessing that the proper way to do this is to pass the child objects to the parent object and have the parent object create them all in a model method. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060620/15defcab/attachment.html