Forum: Ruby on Rails Multi-statement transactions with ActiveRecord

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Wes G. (Guest)
on 2007-06-27 20:50

Using Rails 1.1.6
AR against MS SQL Server (ODBC mode).

I need to do some fancy bulk inserting of data, which I need to ensure
is within a transaction.  But as I think about it, it isn't clear to me
whether what I want to do will work within standard AR.

Can I do something like this:

MyClass.transaction do
  MyClass.connection.execute("arbitrary SQL")

This topic is locked and can not be replied to.