wso2 / andes

Apache License 2.0
39 stars 129 forks source link

Database Error: Duplicate entry 'xxxx' for key ‘PRIMARY’ when inserting Slot Message IDs to MB_SLOT_MESSAGE_ID table #1013

Closed IrushiL closed 5 years ago

IrushiL commented 5 years ago

Description: A "java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'xxxx' for key 'PRIMARY'” database error is seen, when inserting Slot Message IDs to MB_SLOT_MESSAGE_ID table. This happens because the insert operation is retried even after an insertion is done successfully.

Affected Product Versions: wso2mb-3.2.0, wso2mb-3.1.0, all wso2ei versions

Steps to reproduce: Monitor the database errors. This exception is handled within the code, therefore it will not be visible in the wso2mb logs unless a log is added at [1].

[1] - https://github.com/wso2/andes/blob/master/modules/andes-core/broker/src/main/java/org/wso2/andes/store/rdbms/RDBMSAndesContextStoreImpl.java#L1765