On Mon, May 18, 2009 at 10:51 PM, Venkat Eee <
[email protected]> wrote:
>
> Please help me to write an alternative code for below in ROR...
>
> ActiveRecord::Base.connection.execute("LOCK TABLES table_name WRITE")
> ActiveRecord::Base.connection.execute('UNLOCK TABLES')
Venkat, what are you trying to do exactly? It seems that you're trying to
do the
following:
a) lock the table
b) do some db modifications
c) unlock the table
If this is the case, I would recommend reading up on the transaction support
within RoR. If this doesn't do the job for you, you may consider wrapping
these methods in before and after filters respectively at the controller or
model level.
Good luck,
-Conrad
>
>
> Regards,
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---