【发布时间】:2017-12-18 14:27:33
【问题描述】:
我正在使用 org.springframework.security.oauth2 库和 MySQL 5.5.58
大部分时间它都按预期工作,没有任何问题。 但是,似乎当多个请求到“/oauth/token”同时发生(每个在不同的服务器节点上)时,服务器正在争夺数据库记录并且出现死锁:
Handling error: DeadlockLoserDataAccessException, PreparedStatementCallback; SQL [delete from oauth_access_token where token_id = ?]; Deadlock found when trying to get lock; try restarting transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction
有其他人看到这个问题吗?我怎样才能避免这种行为?
谢谢
【问题讨论】:
-
没有人吗?真的吗?
-
我也遇到过同样的问题,但还不知道怎么解决。你解决了吗?
标签: java mysql spring spring-security-oauth2