JBoss 4.0.3 - EJB 3.0 - Exception caused by UNIQUE constrain
jonefun Oct 27, 2005 12:50 PMProblem while attempting to persist data that violates UNIQUE key constrainst.
Exeption is being caught by [JDBCExceptionReporter] but is not being thrown. My Stateless session been is therefore completely unaware of any problem, however my web app handles the EntityBean in disconnected mode catches a RuntimeException
JBoss throws a "java.lang.RuntimeException" and so my
>>>> Exception in JBOSS is :---------------------------------------------------------------
16:33:20,351 WARN [JDBCExceptionReporter] SQL Error: 335544665, SQLState: HY000
16:33:20,351 ERROR [JDBCExceptionReporter] GDS Exception. 335544665. violation of PRIMARY or UNIQUE KEY constraint "INTEG_11907" on table "PERSON"
16:33:20,351 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [com.onlineshop.entity.bean.Person]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
.....
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544665. violation of PRIMARY or UNIQUE KEY constraint "INTEG_11907" on table "PERSON"
at org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:503)
... 33 more
>>>> Exception in WEB APP is :---------------------------------------------------------------
WHACKO : Error : java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=tron/47, BranchQual=, localId=47] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.exception.GenericJDBCException: could not insert: [com.onlineshop.entity.bean.Person])
java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=tron/47, BranchQual=, localId=47] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.exception.GenericJDBCException: could not insert: [com.onlineshop.entity.bean.Person])
at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:185)
....
Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=tron/47, BranchQual=, localId=47] status=STATUS_NO_TRANSACTION; - nested throwable: (org.hibernate.exception.GenericJDBCException: could not insert: [com.onlineshop.entity.bean.Person])
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:354)
... 19 more
Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [com.onlineshop.entity.bean.Person]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
.....
... 20 more
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544665. violation of PRIMARY or UNIQUE KEY constraint "INTEG_11907" on table "PERSON"
at org.firebirdsql.jdbc.AbstractPreparedStatement.internalExecute(AbstractPreparedStatement.java:503)
... 33 more
If anybody can help me understand why no exception is being thrown I would be very grateful. Is this a bug with Firebird JCA JDBC Resource Adapter or is it a problem with JBoss / Hibernate .. or is it just me expecting something that I shouldn't be expecting.
Thanks for reading this far :)
Jono