I am using jboss 4.0.1 with hibernate 2 to connect to Oracle9 with thing jdbc driver (ojdbc14.jar). My Hibernate code resides in a session bean and I access Hibernate sessions via jboss HibernateContext.getSession
I am seeing a weird thing where some jdbc exceptions do *not* get propagated to the caller (me) via HibernateException or any other exception for that matter. Now, that's is not true for all exceptions. If I have a typo in the HQL query referencing non-existing entity, I get HibernateException that tells me all about it. So, that's cool. Troublesome bit is with another piece of code that violates a primary key constraint (as a test case). In that case i get no exception thrown, but information about the error appears happily in the log (as below). Needless to say the actual thing i tried accomplish (an insert in this case) fails, but my code thinks everything went fine. ========== 2005-03-22 14:53:59,497 DEBUG [net.sf.hibernate.impl.BatcherImpl] Executing batch size: 1 2005-03-22 14:53:59,509 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] SQL Exception java.sql.BatchUpdateException: ORA-00001: unique constraint (PK) violated at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:\ 458) at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePrepar\ edStatement.java:3907) at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(Wrappe\ dStatement.java:701) at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher\ .java:54) at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:126) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2421) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2371) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240) at org.jboss.hibernate.session.TransactionSynch.beforeCompletion(TransactionSynch.java:55) [...] ========== What am I missing here ? - ilya. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3871210#3871210 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3871210 ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user