[jboss-jira] [JBoss JIRA] (JGRP-1440) JDBC_PING java.sql.SQLException: ORA-00001: unique constraint violated

Matthew Buckett (JIRA) issues at jboss.org
Thu Jun 22 10:36:00 EDT 2017


    [ https://issues.jboss.org/browse/JGRP-1440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425512#comment-13425512 ] 

Matthew Buckett commented on JGRP-1440:
---------------------------------------

We're using an old version of jGroups in our project and noticed this problem. Looking at this I think it's because in older versions of jGroups the {{org.jgroups.util.DefaultTimeScheduler}} extended {{java.util.concurrent.ScheduledThreadPoolExecutor}} which didn't block concurrent execution of tasks so it could result that multiple tasks were attempting to update the database table concurrently on the same node.

The newer code in {{org.jgroups.util.TimeScheduler3}} looks to prevent a task being added back onto the queue until it has run so it should prevent local concurrent tasks. So I think the changes added in this issue could be removed.

For our project the simplest fix is to just upgrade the version of jGroups we use.

> JDBC_PING java.sql.SQLException: ORA-00001: unique constraint violated
> ----------------------------------------------------------------------
>
>                 Key: JGRP-1440
>                 URL: https://issues.jboss.org/browse/JGRP-1440
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 2.12.1
>         Environment: windows xp, oracle 11G
>            Reporter: freeliuade freeliuade
>            Assignee: Sanne Grinovero
>              Labels: JDBC_PING,
>             Fix For: 3.1
>
>   Original Estimate: 1 week
>  Remaining Estimate: 1 week
>
> using JDBC_PING, create a very simple JChannel, unique constraint violated exception will throw sometimes.
> it's a occationally issue. to easy reproduce it, using debug to let threads hold on JDBC_PING.writeToFile(...). line insert(...) (JDBC_PING line 246 in JGroups2.12.1.Final) you can find three threads will be hold on here. then using debug to step over this line, the unique constraint violated exception will throw.
> I uploaded a debug diagram in here http://ww2.sinaimg.cn/mw600/649a9869jw1dr8m399uqdj.jpg 
> following is the exception stack:
> SEVERE: Error updating JDBC_PING table
> java.sql.SQLException: ORA-00001: unique constraint (HLIUCLUSTER.SYS_C0038277) violated
>         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
>         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
>         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
>         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970)
>         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
>         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
>         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3454)
>         at org.jgroups.protocols.JDBC_PING.insert(JDBC_PING.java:265)
>         at org.jgroups.protocols.JDBC_PING.writeToFile(JDBC_PING.java:246)
>         at org.jgroups.protocols.FILE_PING.sendGetMembersRequest(FILE_PING.java:115)
>         at org.jgroups.protocols.Discovery$PingSenderTask$1.run(Discovery.java:527)
>         at org.jgroups.util.TimeScheduler2$RecurringTask.run(TimeScheduler2.java:592)
>         at org.jgroups.util.TimeScheduler2$MyTask.run(TimeScheduler2.java:524)
>         at org.jgroups.util.TimeScheduler2$Entry.execute(TimeScheduler2.java:429)
>         at org.jgroups.util.TimeScheduler2$1.run(TimeScheduler2.java:295)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:619)



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list