Code:
004-08-26 23:26:40,784 DEBUG [net.sf.hibernate.persister.EntityPersister] - Inserting entity: com.euroflash.gestion.business.Adresse (native id)
2004-08-26 23:26:40,784 DEBUG [net.sf.hibernate.impl.BatcherImpl] - about to open: 0 open PreparedStatements, 0 open ResultSets
2004-08-26 23:26:40,784 DEBUG [net.sf.hibernate.SQL] - insert into Adresse (adresse, codePostal, ville, portable, telephone) values (?, ?, ?, ?, ?)
2004-08-26 23:26:40,784 DEBUG [net.sf.hibernate.impl.BatcherImpl] - preparing statement
2004-08-26 23:26:40,784 DEBUG [net.sf.hibernate.persister.EntityPersister] - Dehydrating entity: [com.euroflash.gestion.business.Adresse#<null>]
2004-08-26 23:26:40,785 DEBUG [net.sf.hibernate.type.StringType] - binding '19 rue de la chate' to parameter: 1
2004-08-26 23:26:40,785 DEBUG [net.sf.hibernate.type.StringType] - binding '75019' to parameter: 2
2004-08-26 23:26:40,785 DEBUG [net.sf.hibernate.type.StringType] - binding 'Paris' to parameter: 3
2004-08-26 23:26:40,785 DEBUG [net.sf.hibernate.type.StringType] - binding '0667852439' to parameter: 4
2004-08-26 23:26:40,785 DEBUG [net.sf.hibernate.type.StringType] - binding null to parameter: 5
2004-08-26 23:26:40,786 DEBUG [net.sf.hibernate.persister.AbstractEntityPersister] - Natively generated identity: 38
2004-08-26 23:26:40,787 DEBUG [net.sf.hibernate.impl.BatcherImpl] - done closing: 0 open PreparedStatements, 0 open ResultSets
2004-08-26 23:26:40,787 DEBUG [net.sf.hibernate.impl.BatcherImpl] - closing statement
2004-08-26 23:26:40,787 DEBUG [net.sf.hibernate.impl.SessionImpl] - saving [com.euroflash.gestion.business.Journalier#<null>]
2004-08-26 23:26:40,787 DEBUG [net.sf.hibernate.impl.SessionImpl] - executing insertions
2004-08-26 23:26:40,787 DEBUG [net.sf.hibernate.persister.EntityPersister] - Inserting entity: com.euroflash.gestion.business.Journalier (native id)
2004-08-26 23:26:40,788 DEBUG [net.sf.hibernate.impl.BatcherImpl] - about to open: 0 open PreparedStatements, 0 open ResultSets
2004-08-26 23:26:40,789 DEBUG [net.sf.hibernate.SQL] - insert into Personne (salaire, ss, visiteMedicale, tauxHoraire, tauxHoraireSupp, idFonction, email, idAdresse, prenom, nom, type) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'JOURNALIER')
2004-08-26 23:26:40,789 DEBUG [net.sf.hibernate.impl.BatcherImpl] - preparing statement
2004-08-26 23:26:40,789 DEBUG [net.sf.hibernate.persister.EntityPersister] - Dehydrating entity: [com.euroflash.gestion.business.Journalier#<null>]
2004-08-26 23:26:40,790 DEBUG [net.sf.hibernate.type.LongType] - binding '123' to parameter: 1
2004-08-26 23:26:40,790 DEBUG [net.sf.hibernate.type.StringType] - binding 'aaaaaaaaaaaaaaaaa' to parameter: 2
2004-08-26 23:26:40,791 DEBUG [net.sf.hibernate.type.TimestampType] - binding '2004-08-26 23:26:38' to parameter: 3
2004-08-26 23:26:40,792 DEBUG [net.sf.hibernate.type.DoubleType] - binding '12.0' to parameter: 4
2004-08-26 23:26:40,794 DEBUG [net.sf.hibernate.type.DoubleType] - binding '15.0' to parameter: 5
2004-08-26 23:26:40,794 DEBUG [net.sf.hibernate.type.LongType] - binding null to parameter: 6
2004-08-26 23:26:40,795 DEBUG [net.sf.hibernate.type.StringType] - binding 'Foo.bar@yahoo.fr' to parameter: 7
2004-08-26 23:26:40,795 DEBUG [net.sf.hibernate.type.LongType] - binding '38' to parameter: 8
2004-08-26 23:26:40,795 DEBUG [net.sf.hibernate.type.StringType] - binding 'Foo' to parameter: 9
2004-08-26 23:26:40,795 DEBUG [net.sf.hibernate.type.StringType] - binding 'bar' to parameter: 10
2004-08-26 23:26:40,796 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] - SQL Exception
java.sql.SQLException: Invalid argument value, message from server: "Duplicate entry 'Foo.bar@yahoo.fr' for key 2"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1697)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1083)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1142)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1876)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1590)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1653)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1492)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:94)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:528)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
...
2004-08-26 23:26:40,883 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - SQL Error: 1062, SQLState: S1009
2004-08-26 23:26:40,883 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - Invalid argument value, message from server: "Duplicate entry 'Foo.bar@yahoo.fr' for key 2"
2004-08-26 23:26:40,884 DEBUG [net.sf.hibernate.impl.BatcherImpl] - done closing: 0 open PreparedStatements, 0 open ResultSets
2004-08-26 23:26:40,884 DEBUG [net.sf.hibernate.impl.BatcherImpl] - closing statement
2004-08-26 23:26:40,884 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] - SQL Exception
...
2004-08-26 23:26:40,886 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - SQL Error: 1062, SQLState: S1009
2004-08-26 23:26:40,886 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - Invalid argument value, message from server: "Duplicate entry 'Foo.bar@yahoo.fr' for key 2"
2004-08-26 23:26:40,886 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - could not insert: [com.euroflash.gestion.business.Journalier]
java.sql.SQLException: Invalid argument value, message from server: "Duplicate entry 'Foo.bar@yahoo.fr' for key 2"
...
2004-08-26 23:26:40,888 DEBUG [net.sf.hibernate.transaction.JDBCTransaction] - rollback
2004-08-26 23:26:41,007 DEBUG [net.sf.hibernate.impl.SessionImpl] - transaction completion
2004-08-26 23:26:41,008 DEBUG [net.sf.hibernate.transaction.JDBCTransaction] - re-enabling autocommit
2004-08-26 23:26:41,009 DEBUG [net.sf.hibernate.impl.SessionImpl] - closing session
2004-08-26 23:26:41,009 DEBUG [net.sf.hibernate.impl.SessionImpl] - disconnecting session
2004-08-26 23:26:41,009 DEBUG [net.sf.hibernate.impl.SessionImpl] - transaction completion
2004-08-26 23:26:41,011 DEBUG [com.euroflash.gestion.manager.ManagerExceptionHandler] - Clé dupliquée, impossible de sauvegarder l'entité com.euroflash.gestion.business.Journalier@d159e4[ss=aaaaaaaaaaaaaaaaa,visiteMedicale=Thu Aug 26 23:26:38 CEST 2004,salaire=123,permisConduire=<null>,tauxHoraire=12.0,tauxHoraireSupp=15.0,fonction=<null>,prenom=Foo,nom=bar,adresse=com.euroflash.gestion.business.Adresse@e6cecc[adresse=19 rue de la chate,codePostal=75019,ville=Paris,telephone=<null>,portable=0667852439,fax=<null>,id=38],email=Foo.bar@yahoo.fr,id=<null>]
The role of my exception handler is to wrap technical exception, every catched Throwable are re-throwed.