@TableGenerator(name = "ParticipantGen", schema = "sa", table = "ADP_TBL_OID", pkColumnName = "TYPE_ID", pkColumnValue = "5321", valueColumnName = "OBJ_NUM", allocationSize = 50)
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator = "ParticipantGen")
private BigInteger objid;
我有一个像上面这样的配置来生成表的主键。 密钥的下一个值是负数。 当我运行流程时,不知何故,JPA不接受-ve数字并在无限循环中运行以获得正数。 因此,应用程序阻塞,因为未释放插入表记录的db线程。
如果有人可以在这里提供帮助,那会很棒。
Log:
302378 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> [0 ms] spent
302378 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> executing prepstmnt 277699 UPDATE SA.ADP_TBL_OID SET OBJ_NUM = ? WHERE TYPE_ID = ? AND OBJ_NUM = ? [params=(long) -2116596711, (String) 5321, (long) -2116596761]
302378 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> [0 ms] spent
302379 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> executing prepstmnt 277700 SELECT OBJ_NUM FROM SA.ADP_TBL_OID WHERE TYPE_ID = ? FOR UPDATE [params=(String) 5321]
302379 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> [0 ms] spent
302379 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> executing prepstmnt 277702 UPDATE SA.ADP_TBL_OID SET OBJ_NUM = ? WHERE TYPE_ID = ? AND OBJ_NUM = ? [params=(long) -2116596661, (String) 5321, (long) -2116596711]
302380 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> [1 ms] spent
302380 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> executing prepstmnt 277703 SELECT OBJ_NUM FROM SA.ADP_TBL_OID WHERE TYPE_ID = ? FOR UPDATE [params=(String) 5321]
302381 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> [1 ms] spent
302381 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> executing prepstmnt 277705 UPDATE SA.ADP_TBL_OID SET OBJ_NUM = ? WHERE TYPE_ID = ? AND OBJ_NUM = ? [params=(long) -2116596611, (String) 5321, (long) -2116596661]
302381 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> [0 ms] spent
302381 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> executing prepstmnt 277706 SELECT OBJ_NUM FROM SA.ADP_TBL_OID WHERE TYPE_ID = ? FOR UPDATE [params=(String) 5321]
302382 openjpa TRACE [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] openjpa.jdbc.SQL - <t -1257420086, conn 73905> [1 ms] spent