Database access in a thread

Hi all,

Even after setting ActiveRecord::Base.allow_concurrency = true in my
controller, I can’t access the database in a new thread that I create
within that controller.

I am trying to start a new thread in my controller after sending out an
email. If after 5 minutes of sending out that email, a response is not
detected (by way of a flag in the database), I need to reset that flag.
So my new thread will sleep for 5 minutes and then check the database
and take the necessary actions.

BackgroundRB seems way too complicated for such a task.

This seems such an easy thing to do in Java and other languages but has
got me stumped here. I have trawled the Internet and looked up all sorts
of books, to no avail!

Any help appreciated.

Vikram

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs