active_presenter icon indicating copy to clipboard operation
active_presenter copied to clipboard

Callback transaction race conditions

Open skiz opened this issue 12 years ago • 2 comments

It seems that save methods call _run_save_callbacks within the transaction, and the data may not have been written to the database by the time that a job is spawned and ran within another instance (such as resque).

You would expect that after_save callbacks would be fired after the the transaction has been completed.

skiz avatar Nov 08 '11 23:11 skiz

Hi Josh,

I haven't used this project in ages so don't really have much motivation to fix things. Have you been able to test and fix in a branch, or found someone that did? Happy to pull if that's the case.

Cheers,

d.

On Tue, Nov 8, 2011 at 6:54 PM, Josh Martin < [email protected]>wrote:

It seems that save methods call _run_save_callbacks within the transaction, and the data may not have been written to the database by the time that a job is spawned and ran within another instance (such as resque).

You would expect that after_save callbacks would be fired after the the transaction has been completed.


Reply to this email directly or view it on GitHub: https://github.com/jamesgolick/active_presenter/issues/4

danielharan avatar Nov 09 '11 16:11 danielharan

I'm looking in to the issue as it is introducing race conditions in a production environment. I should have a fix for it sometime this week.

skiz avatar Dec 12 '11 19:12 skiz