I have noticed that, occasionally, the internal logicaldoc tables start using already used primary keys when populating tables ( history tables, document tables etc. ). This causes internal exceptions, and DB transactions are stopped. This issue seems to occur randomly, but is rather rare.
An example log:
03.10.2017 11:29:17,090 DEBUG (org.hibernate.SQL: 104) -- insert into ld_document (ld_recordversion, ld_lastmodified, ld_deleted, ld_tenantid, ld_immutable, ld_customid, ld_comment, ld_title, ld_version, ld_fileversion, ld_date, ld_creation, ld_publisher, ld_publisherid, ld_creator, ld_creatorid, ld_status, ld_type, ld_lockuserid, ld_source, ld_sourceauthor, ld_sourcedate, ld_sourceid, ld_sourcetype, ld_object, ld_coverage, ld_language, ld_filename, ld_filesize, ld_indexed, ld_barcoded, ld_signed, ld_stamped, ld_digest, ld_recipient, ld_exportstatus, ld_exportid, ld_exportname, ld_exportversion, ld_docref, ld_docreftype, ld_deleteuserid, ld_rating, ld_workflowstatus, ld_published, ld_startpublishing, ld_stoppublishing, ld_transactionid, ld_extresid, ld_tgs, ld_pages, ld_nature, ld_formid, ld_folderid, ld_templateid, ld_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
03.10.2017 11:29:17,096 DEBUG (org.hibernate.engine.jdbc.spi.SqlExceptionHelper: 139) -- ERROR: duplicate key value violates unique constraint "ld_document_pkey"
Detail: Key (ld_id)=(3473408) already exists. [n/a]
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "ld_document_pkey"
Detail: Key (ld_id)=(3473408) already exists.
.... stack trace folows ....
After that, hybernate errors would be logged:
03.10.2017 11:29:17,103 DEBUG (org.hibernate.engine.jdbc.spi.SqlExceptionHelper: 139) -- ERROR: current transaction is aborted, commands ignored until end of transaction block [n/a]
org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
.... stack trace folows ....
In my case, this has happened separately to following tables:
- ld_document
ld_user_history
Does anyone know the cause of this issue? I have not manually fiddled with the logicaldoc db and thus have no idea why the pkeys would overlap at any point. It seems to me that this is an internal problem not related to the usage of logicaldoc.
While searching the forums, I have found only a single thread in which a user has a similar issue, albeit it seems to had accured due to the way that user restored the DB.
Regards,
Ragnhild