cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA Unique Constraint Violated Error [301]

aelmaser
Explorer
0 Kudos
294

Hi everyone,

In our SAP HANA database, we're adding a row to a table with a query from MII Workbench when our machine creates a product. When we trying to add, query returns this message;

 

com.sap.xmii.Illuminator.logging.LHException: com.sap.sql.exception.OpenSQLIntegrityConstraintViolationException: [301]: unique constraint violated: Table(CURING_LOG), Index(_SYS_TREE_CS_#199412_#0_#P0) with error: unique constraint violation on pos=0 for table OMQ::CURING:CURING_LOG$delta_1$en, key: $trexexternalkey$=2024-10-04;23:17:04;5,DNZ5R already exists as udiv=24121, indexname=_SYS_TREE_CS_#199412_#0_#P0

               OpenSQLExceptionCategories: [NON_TRANSIENT, INTEGRITY_CONSTRAINT_VIOLATION]

Our table's constraint are 3 columns ; ZBITIS_T , ZBITIS_S and ARBPL as shown in below ;

aelmaser_0-1728073878171.png

and the _SYS_TREE_CS_#199412_#0_#P0 is this ;

aelmaser_1-1728073948368.png

What I understand, error message tells me that I'm trying to add a record that already exist in the table. There has to be a record that equals in ZBITIS_T, ZBITIS_S and ARBPL with the record that I'm trying to. But there is not. I'm certain that we trying to write record only once. 

And somehow, record writes to table successfully but that error message comes also.

aelmaser_2-1728074542188.png

aelmaser_3-1728074604791.png

So my question is to you, how could this happening ? Why am I seeing that error message even the record can be seen in table ?

Thanks,

View Entire Topic
aelmaser
Explorer
0 Kudos

Hello junwu,

Query runs in a transaction and I'm logging every time when transaction starts. I checked the logs and transaction runs only once. And transaction only have one query there is no other query can duplicate the record.

Thanks,