about exception message

Discussion in 'Java' started by Spark, Mar 1, 2008.

  1. Spark

    Spark Guest

    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
     
    Spark, Mar 1, 2008
    #1
    1. Advertising

  2. Spark wrote:

    > 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.
    --
    Sabine Dinis Blochberger

    Op3racional
    www.op3racional.eu
     
    Sabine Dinis Blochberger, Mar 3, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWc=?=
    Replies:
    1
    Views:
    2,146
    Marshal Antony
    Feb 8, 2004
  2. =?Utf-8?B?bWc=?=

    Size of e-mail message - message.Body = msgText

    =?Utf-8?B?bWc=?=, Feb 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    570
    Chad Z. Hower aka Kudzu
    Feb 11, 2004
  3. - Steve -
    Replies:
    0
    Views:
    705
    - Steve -
    Jul 6, 2004
  4. tshad
    Replies:
    0
    Views:
    799
    tshad
    Jan 27, 2005
  5. Replies:
    2
    Views:
    572
    sloan
    Aug 18, 2006
Loading...

Share This Page