Joined: Fri Jun 20, 2008 7:46 pm Posts: 1
|
i want to throw the exception to the front end user.
But i get the error only in the log.
Code snippet is:
Service class:
try{userDao.save(user);
} catch (Exception e) {
throw e;
}
finally {return user;}
userDao class:
public void save(User user) {
getHibernateTemplate().saveOrUpdate(user);
getHibernateTemplate().flush();
}
Error message:
SQL Error: 1, SQLState: 23000
ORA-00001: unique constraint (SYS_C0012066) violated
Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
|
|