[Catalyst] Session duplicate key constraints on concurrent
requests
Janne Snabb
snabb at epipe.com
Fri Oct 7 16:38:55 GMT 2011
On Friday 07 October 2011 14:48:14 Tobias Kremer wrote:
> 3. Both requests try to insert a new session, one succeeds, the other
> dies(!) with a duplicate key constraint error from MySQL.
Sounds like this should be changed from "insert" to "insert_or_update"
which is wrapped within a transaction with "serializable" transaction
isolation level (because we might not know if the "insert_or_update"
method is atomic)... or something along those lines without looking
at the code.
Or alternatively the failed read of old cookie and the insert of the
new cookie could be wrapped in a single "serializable" transaction.
--
Janne Snabb / EPIPE Communications
snabb at epipe.com - http://epipe.com/
More information about the Catalyst
mailing list