Getting Internal server error: Violation of PRIMARY KEY constraint in Cluster

Situation: We are getting below errors and the jobs which uses backend tables are failing.

  • Error Message1:

Error message :: An exception occurred on executing process instance id 010240013192155255811510242183:Internal server error: Violation of PRIMARY KEY constraint ''PK__AC_TRANS__3214EC27CC22A986''. Cannot insert duplicate key in object ''dbo.AC_TXN_EXE_LOG''. The duplicate key value is (11552510801188).

 

  • Error Message2:

Error while persisting connection execution error information. Reason:: Error while persisting transaction execution information. Reason:: could not insert: [com.adeptia.connect2.log.storage.entities.TransactionExecutionLogger]; SQL [insert into AC_TXN_EXE_LOG (DESTINATION, DIRECTION, ENDTIME, EXECUTION_RERUN, FILE_SIZE, FLOW_EXECUTION_INFO, HUB_COMPANY_ID, HUB_COMPANY_NAME, JOB_ID, LOG_MESSAGE, MAIN_EXECUTION_RECORD, MESSAGE_TYPE, NETWORK_ID, NETWORK_NAME, PARENT_EXECUTION_ID, PARTNER_ID, PARTNER_NAME, PROCESS_ID, PROCESS_INSTANCE_ID, RECORD_TYPE, REFERENCE_FIELD, RERUN_MODE, RUNTIME_INFO, SOURCE, SOURCE_FILE_LOCATION, SOURCE_FILE_NAME, STARTTIME, STATUS, TARGET_FILE_LOCATION, TARGET_FILE_NAME, TRANSACTION_ID, TRANSACTION_NAME, TRANSACTION_TEMPLATE_ID, TRANSACTION_TEMPLATE_NAME, TRANSACTION_TYPE, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [com.adeptia.connect2.log.storage.entities.TransactionExecutionLogger]: could not insert: [com.adeptia.connect2.log.storage.entities.TransactionExecutionLogger]; SQL [insert into AC_TXN_EXE_LOG (DESTINATION, DIRECTION, ENDTIME, EXECUTION_RERUN, FILE_SIZE, FLOW_EXECUTION_INFO, HUB_COMPANY_ID, HUB_COMPANY_NAME, JOB_ID, LOG_MESSAGE, MAIN_EXECUTION_RECORD, MESSAGE_TYPE, NETWORK_ID, NETWORK_NAME, PARENT_EXECUTION_ID, PARTNER_ID, PARTNER_NAME, PROCESS_ID, PROCESS_INSTANCE_ID, RECORD_TYPE, REFERENCE_FIELD, RERUN_MODE, RUNTIME_INFO, SOURCE, SOURCE_FILE_LOCATION, SOURCE_FILE_NAME, STARTTIME, STATUS, TARGET_FILE_LOCATION, TARGET_FILE_NAME, TRANSACTION_ID, TRANSACTION_NAME, TRANSACTION_TEMPLATE_ID, TRANSACTION_TEMPLATE_NAME, TRANSACTION_TYPE, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [com.adeptia.connect2.log.storage.entities.TransactionExecutionLogger]

 

Cause: This issue occurs when the sequence id for all the server in the cluster is set to "1".

 

Solution: To resolve the issue, we need to set the value of the sequence id to 2 and 3 for other nodes in a cluster. Following are the steps to be performed on each cluster server:-

  1. Goto the location "\ConnectServer\AdeptiaServer\ServerKernel\etc" and open the server-configure.properties file in an edit mode.
  2. Search for property "abpm.config.sequence.id" and set its value to 2. Ensure that this value is unique for each node.

After making the above changes, kindly restart the servers.

Note: It is one of the necessary steps while configuring Cluster in Adeptia Connect and documented at step-14 in the document here: Enabling clustering.

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.