seata集成spring quartz框架无法支持复合主键(解决方案)

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

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(

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值