Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-3778

ClusteredCacheWithAsyncDirTest throws lots of "org.h2.jdbc.JdbcSQLException: Unique index or primary key violation"

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The tests runs two nodes on same machine, each configured to use a jdbc cachestore running on same database. This clash leads to:

      2013-12-02 15:50:26,159 ERROR [JdbcStringBasedStore] (AsyncStoreProcessor-LuceneIndexesData_custom1-23) ISPN008024: Error while storing string key to database; key: '_0.fdx|0|16384|person'
      org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_E ON PUBLIC.""ISPN_STRING_TABLE_LuceneIndexesData_custom1""(ID_COLUMN)"; SQL statement:
      INSERT INTO "ISPN_STRING_TABLE_LuceneIndexesData_custom1" (DATA_COLUMN, TIMESTAMP_COLUMN, ID_COLUMN) VALUES(?,?,?) [23505-166]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
      	at org.h2.message.DbException.get(DbException.java:169)
      	at org.h2.message.DbException.get(DbException.java:146)
      	at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:81)
      	at org.h2.index.TreeIndex.add(TreeIndex.java:62)
      	at org.h2.table.RegularTable.addRow(RegularTable.java:121)
      	at org.h2.command.dml.Insert.insertRows(Insert.java:124)
      	at org.h2.command.dml.Insert.update(Insert.java:84)
      	at org.h2.command.CommandContainer.update(CommandContainer.java:73)
      	at org.h2.command.Command.executeUpdate(Command.java:226)
      	at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143)
      	at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
      	at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.write(JdbcStringBasedStore.java:166)
      	at org.infinispan.persistence.async.AsyncCacheWriter.applyModificationsSync(AsyncCacheWriter.java:154)
      	at org.infinispan.persistence.async.AsyncCacheWriter$AsyncStoreProcessor.retryWork(AsyncCacheWriter.java:329)
      	at org.infinispan.persistence.async.AsyncCacheWriter$AsyncStoreProcessor.run(AsyncCacheWriter.java:313)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:724)
      2013-12-02 15:50:26,392 ERROR [JdbcStringBasedStore] (persistence-thread-2,NodeL) ISPN008007: SQL error while fetching all StoredEntries
      org.h2.jdbc.JdbcSQLException: Table "ISPN_STRING_TABLE_LuceneIndexesMetadata_custom1" not found; SQL statement:
      SELECT DATA_COLUMN,ID_COLUMN, TIMESTAMP_COLUMN FROM "ISPN_STRING_TABLE_LuceneIndexesMetadata_custom1" WHERE TIMESTAMP_COLUMN > ? OR TIMESTAMP_COLUMN < 0 [42102-166]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
      	at org.h2.message.DbException.get(DbException.java:169)
      	at org.h2.message.DbException.get(DbException.java:146)
      	at org.h2.command.Parser.readTableOrView(Parser.java:4757)
      	at org.h2.command.Parser.readTableFilter(Parser.java:1084)
      	at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1690)
      	at org.h2.command.Parser.parseSelectSimple(Parser.java:1797)
      	at org.h2.command.Parser.parseSelectSub(Parser.java:1684)
      	at org.h2.command.Parser.parseSelectUnion(Parser.java:1527)
      	at org.h2.command.Parser.parseSelect(Parser.java:1515)
      	at org.h2.command.Parser.parsePrepared(Parser.java:405)
      	at org.h2.command.Parser.parse(Parser.java:279)
      	at org.h2.command.Parser.parse(Parser.java:251)
      	at org.h2.command.Parser.prepareCommand(Parser.java:217)
      	at org.h2.engine.Session.prepareLocal(Session.java:415)
      	at org.h2.engine.Session.prepareCommand(Session.java:364)
      	at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1111)
      	at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:71)
      	at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:266)
      	at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:213)
      	at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore$2.call(JdbcStringBasedStore.java:321)
      	at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore$2.call(JdbcStringBasedStore.java:309)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:724)
      

      Despite these exceptions being logged, the test does not fail.

              anistor Adrian Nistor (Inactive)
              anistor Adrian Nistor (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: