seata集成spring quartz框架无法支持复合主键
报错信息:
org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: io.seata.common.exception.NotSupportYetException: qrtz_locks contains multi PK, but current not support. [See nested exception: java.sql.SQLException: io.seata.common.exception.NotSupportYetException: qrtz_locks contains multi PK, but current not support.]
at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:184)
at org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:113)
at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:238)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobAndTrigger(JobStoreSupport.java:1063)
at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:855)
at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:249)
.................................
Caused by: java.sql.SQLException: io.seata.common.exception.NotSupportYetException: qrtz_locks contains multi PK, but current not support.
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:112)
at io.seata.rm.datasource.exec.ExecuteTemplate.execute(ExecuteTemplate.java:49)
at io.seata.rm.datasource.PreparedStatementProxy.executeQuery(PreparedStatementProxy.java:59)
at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:123)
... 156 more
Caused by: io.seata.common.exception.NotSupportYetException: qrtz_locks contains multi PK, but current not support.
at io.seata.rm.datasource.sql.struct.TableMeta.getPrimaryKeyMap(
Seata与Spring Quartz复合主键冲突

本文解决了一个在Seata与Spring Quartz框架集成时遇到的问题,即Seata不支持Spring Quartz的复合主键,导致数据库锁获取失败。通过修改数据库表结构,将复合主键替换为单一主键QID,成功解决了这一问题。
最低0.47元/天 解锁文章
1586

被折叠的 条评论
为什么被折叠?



