Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 2.7
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using: DB2 8.0
The generated SQL (show_sql=true): true
Debug level Hibernate log excerpt:
Code:
try
{
beginTransaction();
try
{
getSessionManager().save(ABCDO);
}
catch(HibernateException he)
{
//call the update in case of constraintVoilationException
getSessionManager().update(ABCDO);
}
commitTransaction();
}
catch(HibernateException he)
{
}
finally
{
closeSession();
}
it throws the ConstraintVoilationException during the commitTransaction() but not during the save call
is there way to catch ConstraintVoilationException during the save call itself