[ModeShape 5.x, Oracle 11g] Occasional SQLIntegrityConstraintViolationException when storing a binary value
illia.khokholkov Mar 21, 2017 5:29 PMI was running abilities testing of the application that utilizes ModeShape 5.x. in a clustered environment (currently, there are 4 members in the cluster). Specifically, such an application is currently running on the latest 5.4-SNAPSHOT of ModeShape. I have a fairly simple test case, where there are N consumers updating N files in parallel, one thread per consumer. Every time fileN needs to be updated, it gets locked first, using shallow session-scoped lock. Every fileN gets updated exactly once. There is no lock contention to update the same fileN. Every time an update needs to be made, the next member of the cluster is requested, i.e. round-robin method is in use. The layout of the repository is presented below:
- root - folder1 - file1 - ... - ... - folderN - fileN
Occasionally, the following exception occurs:
org.modeshape.jcr.value.ValueFormatException: Error converting InputStream to a BinaryValue at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:247) at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:49) at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:142) at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:41) ... Caused by: org.modeshape.jcr.value.binary.BinaryStoreException: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (ORACLE_SCHEMA_NAME.SYS_C003304428) violated at org.modeshape.jcr.value.binary.DatabaseBinaryStore.dbCall(DatabaseBinaryStore.java:335) at org.modeshape.jcr.value.binary.DatabaseBinaryStore.storeValue(DatabaseBinaryStore.java:162) at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:244) ... Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (ORACLE_SCHEMA_NAME.SYS_C003304428) violated at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1046) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3714) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378) at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) at org.modeshape.jcr.value.binary.Database.execute(Database.java:408) at org.modeshape.jcr.value.binary.Database.insertContent(Database.java:244) at org.modeshape.jcr.value.binary.DatabaseBinaryStore.lambda$storeValue$0(DatabaseBinaryStore.java:177) at org.modeshape.jcr.value.binary.DatabaseBinaryStore.dbCall(DatabaseBinaryStore.java:331) ...
In general, does SQLIntegrityConstraintViolationException represent something that you could normally expect from ModeShape when running in a clustered environment? Is this related to the way JGroups messages get delivered, i.e. asynchronous delivery? Many thanks in advance, your help is greatly appreciated.