In my module that I'm working on, I got this error, which is said to be caused by org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update and java.sql.BatchUpdateException (full stack trace is here: click here ) .
From what I read from other posts, this is certainly caused by a primary key violation. However, I could not even reproduce the problem, so that I could at least trace the real error and solve the problem. Each time I inserted an identical record with one that is already in the database, it will simply merge with each other and without errors. However, I was getting a lot of this deployment error, so I'm not quite sure what is happening on the deployment server (I'm just a student student, so I still love "noob").
I would appreciate it if someone could point me in the direction. Thank you (Let me know if something needs to be added)
Here is a fragment of hibernation display for a module (I hope this helps):
<hibernate-mapping package="edu.umd.cattlab.schema.cattXML.extensions.VaTraffic" default-lazy="false" default-cascade="all, delete-orphan" schema="vatraffic"> <typedef class="edu.umd.cattlab.schema.hibernate.util.XMLGregorianCalendarType" name="XMLCal"/> <class name="VaTrafficAssociatedEvent" table="associated_event"> <id name="associatedEventId" column="associated_event_id"> <generator class="sequence"> <param name="sequence">ritis.associated_event_id_seq</param> </generator> </id> <property name="secondaryEventId" column="secondary_event_id" not-null="true" /> <property name="unassociatedTimestamp" type="XMLCal" column="unassociated" /> <property name="autoRelated" column="auto_related" not-null="true" /> <many-to-one name="relationshipType" column="relationship_type" not-null="true" cascade="none" /> </class>
This is the part of Java code that uses the above mapping: click here
source share