Skip to main content
pavang5769
August 5, 2024
Question

Error occurred while writing the data to datastore - Could not execute JDBC batch update: java.sql.BatchUpdateException: ORA-00001: unique constraint

  • August 5, 2024
  • 7 replies
  • 0 views

Hi All,

We are using "write to data store entity" smart service for storing the data into the database and getting the below error and there are no unique constraints declared in the XSD and Table.

Below are the two requests which occurred while executing the smart service

Error 1:

An error occurred while trying to write to the entity "VT_TASK_MASTER" [id=99aa89ed-622b-477f-9671-2c22df01831b@1429, type=VT_TASK_MASTER (id=3112)] (data store: VT Tables). Details: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update: java.sql.BatchUpdateException: ORA-00001: unique constraint (APPIANBUSINESS_PROD.SYS_C0059560507) violated
Data: TypedValue[it=3113,v={{<null>,43,Initiation,initiation,1,Employee,User(s),7,1,ltideploymentAccount,2024-08-05 14:47:12.64,,<null>,1,[Group:1261],0}}]

Error 2:

An error occurred while trying to write to the entity "VT_TASK_MASTER" [id=99aa89ed-622b-477f-9671-2c22df01831b@1429, type=VT_TASK_MASTER (id=3112)] (data store: VT Tables). Details: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update: java.sql.BatchUpdateException: ORA-00001: unique constraint (APPIANBUSINESS_PROD.SYS_C0059560507) violated
Data: TypedValue[it=3113,v={{<null>,61,Initiation,Initation,1,Employee,User(s),10,1,ltideploymentAccount,2024-08-05 15:27:37.16,,<null>,1,,0}}]

7 replies

August 6, 2024

There must be some constraint in a database named 'APPIANBUSINESS_PROD.SYS_C0059560507'. Check the database for details.

pavang5769
August 6, 2024

There is only one unique constraint for Primary Key of the table.

karumurua531442
August 6, 2024

hi [mention:e43de91b303547b280db3d3d5e5bd7e1:e9ed411860ed4f2ba0265705b8793d05]  all the fields you are trying to save have default as null in your DB except your primary key, you could check your DB columns if any of your columns are not null type and your passing null value from PM would cause the issue 

pavang5769
August 6, 2024

All of the columns has default configuration of null apart from the Primary key column.

davidj137213
August 6, 2024

And do you have  a sequence in your PK?

prasantap0900
August 6, 2024

In your database column the value should be "None" instead of "Null". Set the all the column values as none. Only ID which is primary key can be null. Please check with that. 

davidj137213
August 6, 2024

DO you have a sequence defined in your PK? If not, Oracle won't be able to insert the data because of that...

Your first and last field are null... I guess the first is the PK, and must contain a value, or the value has to be generated by a sequence in DDBB