Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock wait timeout exceeded #22

Open
happenedIn opened this issue Jan 6, 2025 · 1 comment
Open

Lock wait timeout exceeded #22

happenedIn opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@happenedIn
Copy link

When calling

Enforcer casbinEnforcer = new Enforcer();
casbinEnforcer.addRoleForUser(user, role);

I get lock wait timeout.

Why are there updates following an insert statement in this code?

session.createSQLQuery("UPDATE casbin_rule SET v1 = null WHERE v1 = 'null'").executeUpdate();

[local] 2025-01-03 16:37:05.084 DEBUG [http-nio-8080-exec-4] TransactionImpl    - On TransactionImpl creation, JpaCompliance#isJpaTransactionComplianceEnabled == false
[local] 2025-01-03 16:37:05.084 DEBUG [http-nio-8080-exec-4] TransactionImpl    - begin
[local] 2025-01-03 16:37:05.171 DEBUG [http-nio-8080-exec-4] SQL    - INSERT INTO casbin_rule (id,ptype,v0,v1,v2,v3,v4,v5) VALUES (4, 'g','userA','role_api','null','null','null','null')
[local] 2025-01-03 16:37:11.821 DEBUG [http-nio-8080-exec-4] SQL    - UPDATE casbin_rule SET v1 = null WHERE v1 = 'null'
[local] 2025-01-03 16:38:02.831 WARN [http-nio-8080-exec-4] ErrorPacket    - Error: 1205-HY000: Lock wait timeout exceeded; try restarting transaction
[local] 2025-01-03 16:38:02.835 ERROR [http-nio-8080-exec-4] SqlExceptionHelper    - (conn=40) Lock wait timeout exceeded; try restarting transaction
[local] 2025-01-03 16:39:39.340 DEBUG [http-nio-8080-exec-4] TransactionImpl    - committing
@hsluoyz
Copy link
Member

hsluoyz commented Jan 6, 2025

@tangyang9464 @imp2002

@hsluoyz hsluoyz added the question Further information is requested label Jan 6, 2025
@hsluoyz hsluoyz self-assigned this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants