about exception message

S

Spark

Hi here,

I got a problem in my program. Spring+hibernate+postgresql were used
in my case.
I manipulate data use HibernateTemplate from spring, sometime I do
some operation to break the database constraint, such as insert a
duplicate key record. I obtain the reason of exception by mothed
getMessage(). the following message was presented
"Could not execute JDBC batch update; nested exception is
org.hibernate.exception.ConstraintViolationException: Could not
execute JDBC batch update".
But it's not as me might expect. I wanted the orignal message from the
database.

Appriciate anyone who point me out!

lx
 
S

Sabine Dinis Blochberger

Spark said:
Hi here,

I got a problem in my program. Spring+hibernate+postgresql were used
in my case.
I manipulate data use HibernateTemplate from spring, sometime I do
some operation to break the database constraint, such as insert a
duplicate key record. I obtain the reason of exception by mothed
getMessage(). the following message was presented
"Could not execute JDBC batch update; nested exception is
org.hibernate.exception.ConstraintViolationException: Could not
execute JDBC batch update".
But it's not as me might expect. I wanted the orignal message from the
database.

I would say look at the PostgreSQL logs.
Appriciate anyone who point me out!

lx

The word ConstraintViolationException makes me think you tried to insert
a primary key that already exists, or a foreign key that doesn't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top