Forum: Ruby on Rails fastcgi help!!!

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.
Manish S. (Guest)
on 2006-05-03 21:45
(Received via mailing list)
Something really weird happened with my app recently and i'm lost on
exactly happened.

I have a bunch of validations setup in my models to ensure that no
have identical columns within a certain date range.  So user x can only
a blog entry to blog y once a month (example).

However, i saw that this validation failed on script that posts a bunch
entries all by the same user.  So the db showed the same user posting to
same blog all within a few seconds of each other.

I looked at my access log and saw that there were 2 HTTP POSTs to the
controller at the same time that these duplicate entries got saved.  I
this weird because i had the validations in place, and when i test on my
laptop i'm not able to recreate it.  This made me think about fastcgi as
culprit.  Could it be that 2 fastcgi processes go the request at the
time and independently validated the data?  Meaning that when either
process did a read to validate, they both passed because neither had
committed the data yet.

Does this sound reasonable?  If so, how would i go about guarding

Please, please help.  Thanks in advance.
Kelly F. (Guest)
on 2006-07-28 10:35
(Received via mailing list)
I think I'm seeing the same thing. I have a model, Member, that has:

validates_uniqueness_of   :email

Yet, I have some non-unique emails. I've got a test that tries to create
members with the same email and it fails appropriately.

Any suggestions?


This topic is locked and can not be replied to.