moqui / moqui-framework

Use Moqui Framework to build enterprise applications based on Java. It includes tools for databases (relational, graph, document), local and web services, web and other UI with screens and forms, security, file/resource access, scripts, templates, l10n, caching, logging, search, rules, workflow, multi-instance, and integration.
http://www.moqui.org
Other
279 stars 199 forks source link

deadlock of Login #589

Open daiagou opened 1 year ago

daiagou commented 1 year ago

If a user logs out of the login, then in the "user_account" table, their "has_logged_out" will be Y, and calling the "popstore.CustomerServices.postLogin#Customer" method will cause a deadlock.

We have found the reason. Because logging in will generate an apiKey (insert into user_login_key), which is generated by a new transaction, and at this time, it is also necessary to update the "has_logged_out" (update user_account by another transaction) in the "user_account" table, The 'user_id' foreign key in the 'user_login_key' table is associated with the 'user_id' in the 'user_account' table. So it will trigger a deadlock.

arun521414 commented 1 year ago

i am facing this issue..beacause my authentication configuration was wrong.. storing set cookie in browser.. send cookies when u call logout endpoint its work fine