Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

Membership Provider - Updating the same row cause deadlock (2 replies)

$
0
0
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.

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>