Fehlerbehebung
Wenn man Classifer aus einer Enum löscht und wieder einfügt - je nachdem wo man einfügt erhält man unterschiedliche Fehlermeldungen, z.B.:
com.top_logic.knowledge.service.KnowledgeBaseException: Database operation failed.
at com.top_logic.knowledge.service.db2.DefaultDBContext.commitTransaction(DefaultDBContext.java:861)
at com.top_logic.knowledge.service.db2.TransactionImpl.internalCommit(TransactionImpl.java:164)
at com.top_logic.knowledge.service.AbstractTransaction.commit(AbstractTransaction.java:73)
at com.top_logic.layout.form.declarative.DeclarativeApplyHandler.doTransaction(DeclarativeApplyHandler.java:111)
... 35 more
Caused by: java.sql.SQLException: Unique index or primary key violation: "PUBLIC.FAST_LIST_ELT_FAST_LIST_ELT_OWNER_ORDER_IDX ON PUBLIC.FAST_LIST_ELT(BRANCH NULLS FIRST, OWNER_ID NULLS FIRST, SORT_ORDER NULLS FIRST, REV_MAX NULLS FIRST) VALUES ( /* key:80 */ CAST(1 AS BIGINT), CAST(8064 AS BIGINT), 5, 9223372036854775807)"; SQL statement:
INSERT INTO "FAST_LIST_ELT" ("BRANCH","IDENTIFIER","REV_MAX","REV_MIN","REV_CREATE","PHYSICAL_RESOURCE","ANNOTATIONS","OWNER_ID","NAME","SORT_ORDER","DESCR","FLAGS") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-224]: INSERT INTO "FAST_LIST_ELT" ("BRANCH","IDENTIFIER","REV_MAX","REV_MIN","REV_CREATE","PHYSICAL_RESOURCE","ANNOTATIONS","OWNER_ID","NAME","SORT_ORDER","DESCR","FLAGS") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
at com.top_logic.basic.sql.SQLH.enhanceMessage(SQLH.java:594)
at com.top_logic.basic.db.sql.PrepStmtBasedCompiledStatement.enhanceMessage(PrepStmtBasedCompiledStatement.java:144)
at com.top_logic.basic.db.sql.PrepStmtBasedCompiledStatement$1.executeBatch(PrepStmtBasedCompiledStatement.java:131)
at com.top_logic.knowledge.service.db2.DefaultDBAccess.executeInsertBatch(DefaultDBAccess.java:403)
at com.top_logic.knowledge.service.db2.DefaultDBAccess.insertAll(DefaultDBAccess.java:371)
at com.top_logic.knowledge.service.db2.VersionedDBAccess.storeAll(VersionedDBAccess.java:505)
at com.top_logic.knowledge.service.db2.VersionedDBAccess.insertAll(VersionedDBAccess.java:489)
at com.top_logic.knowledge.service.db2.DefaultDBContext.commitNew(DefaultDBContext.java:537)
at com.top_logic.knowledge.service.db2.DefaultDBContext.commitTransaction(DefaultDBContext.java:790)
... 38 more
Caused by: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.FAST_LIST_ELT_FAST_LIST_ELT_OWNER_ORDER_IDX ON PUBLIC.FAST_LIST_ELT(BRANCH NULLS FIRST, OWNER_ID NULLS FIRST, SORT_ORDER NULLS FIRST, REV_MAX NULLS FIRST) VALUES ( /* key:80 */ CAST(1 AS BIGINT), CAST(8064 AS BIGINT), 5, 9223372036854775807)"; SQL statement:
INSERT INTO "FAST_LIST_ELT" ("BRANCH","IDENTIFIER","REV_MAX","REV_MIN","REV_CREATE","PHYSICAL_RESOURCE","ANNOTATIONS","OWNER_ID","NAME","SORT_ORDER","DESCR","FLAGS") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-224]
at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1282)
at com.top_logic.basic.db.sql.AbstractStatementBatch.executeBatch(AbstractStatementBatch.java:46)
at com.top_logic.basic.db.sql.PrepStmtBasedCompiledStatement$1.executeBatch(PrepStmtBasedCompiledStatement.java:129)
... 44 more
Test
- /com.top_logic.demo/src/test/java/test/com/top_logic/demo/scripted/model/TestEnumEdit.script.xml