0
votes

I've been sending several data to a Spring server from a c# client by http post. But, when I send the same data from a java client, theses errors occur.

root cause

org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:326) org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120) org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:516) org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

On the Spring server, I checked if there is any difference in the arrived datas, but there seem to be no differences between them. Why is this happening?

1
Please share the java code. - Mithun

1 Answers

0
votes

Your stacktrace clearly states that you are getting a ConstraintViolationException. That is you might have defined some constraints for saving data in db. When you are hitting your app with rest client may be you are trying to save or update something that fails any of your db level constraints.