I am trying to run a an external process after a update from the view.
I currently have it set up to run after_update but it seems that the
transaction it uses hasn't been closed at that point. My process is
supposed to check some variables in the database and change a specific
column in the database. Now because the transaction hasn't been closed
it results in a deadlock. Does any one have a good work around to
achieve this?
I am trying to run a an external process after a update from the view.
I currently have it set up to run after_update but it seems that the
transaction it uses hasn't been closed at that point. My process is
supposed to check some variables in the database and change a specific
column in the database. Now because the transaction hasn't been closed
it results in a deadlock. Does any one have a good work around to
achieve this?
One hack is to put something like "sleep 2" at the beginning of the
external process. Or call the external process from your controller.
Or change the transaction visibility level of your external-process
DB connection.
But it'd be nice if transaction calls could again take model instance
parameters, allowing implementation of an after_commit callback.