Membership Provider - Updating the same row cause deadlock
Posted by: Avi Mandelberg
Date: December 02, 2012 05:20AM

I have 2 location in my web application that updating the tables: 'my_aspnet_membership', 'my_aspnet_users'.
The updates run on separate threads and cause deadlock.

The updates are part of 2 functions in "MySql Membership Provider":
1. ValidateUser()
2. GetUser()

I'm updating the same row all the time (for the same membership user).

These queries are part of "MySql Membership Provider" that cause the deadlock:

First query: (called from VerifyUser())
UPDATE my_aspnet_membership m, my_aspnet_users u SET u.lastActivityDate = '2012-11-29 18:35:46.380', m.LastActivityDate='2012-11-29 18:35:46.380' WHERE m.userId=1 AND u.id=1

Second Query: (called from GetUser())
BEGIN
UPDATE my_aspnet_users SET lastActivityDate = '2012-11-29 18:35:46.384' WHERE id=1
UPDATE my_aspnet_membership SET LastActivityDate='2012-11-29 18:35:46.384' WHERE userId=1
COMMIT

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Membership Provider - Updating the same row cause deadlock
December 02, 2012 05:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.