probleme avec la methode save
bonjour je comprends pas le comportement de mon code par rapport a hibernate
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
public void update(ca.canassistance.pojo.BaseAvinfoge avinfoge)
throws net.sf.hibernate.HibernateException, Exception{
Session session = null;
Transaction tx = null;
try {
session = HibernateUtil.currentSession();
tx = session.beginTransaction();
session.saveOrUpdate(avinfoge);
tx.commit();
HibernateUtil.closeSession();
} catch (HibernateException e) {
if (tx != null)
tx.rollback();
HibernateUtil.closeSession();
e.printStackTrace();}
catch (Exception e)
{
e.printStackTrace();
}
} |
et le message d erreur
19:55:42,192 DEBUG EntityPersister:627 - Updating entity: [ca.canassistance.pojo.BaseAvinfoge#ca.canassistance.pojo.AvinfogeId@be38819b]
19:55:42,192 DEBUG BatcherImpl:204 - about to open: 0 open PreparedStatements, 0 open ResultSets
19:55:42,192 DEBUG SQL:230 - update AVINFOGE set IG_ID_DOUBLE_ASS=?, IG_GROUPE_CLIENT=?, IG_NO_CERTIFICAT_SAM=?, IG_ID_USER=?, IG_DT_MODIF=?, IG_ID_ACCIDENT=? where IG_NO_GROUPE=? and IG_NO_CERTIFICAT=? and IG_DT_EVENEMENT=? and IG_NO_DOSSIER=?
19:55:42,192 DEBUG BatcherImpl:253 - preparing statement
19:55:42,192 DEBUG EntityPersister:382 - Dehydrating entity: [ca.canassistance.pojo.BaseAvinfoge#ca.canassistance.pojo.AvinfogeId@be38819b]
19:55:42,192 DEBUG StringType:46 - binding 'N' to parameter: 1
19:55:42,192 DEBUG StringType:46 - binding ' ' to parameter: 2
19:55:42,192 DEBUG StringType:46 - binding '18499190 ' to parameter: 3
19:55:42,192 DEBUG StringType:46 - binding 'STAR' to parameter: 4
19:55:42,192 DEBUG IntegerType:46 - binding '20090205' to parameter: 5
19:55:42,192 DEBUG StringType:46 - binding 'N' to parameter: 6
19:55:42,192 DEBUG StringType:46 - binding '052340' to parameter: 7
19:55:42,192 DEBUG StringType:46 - binding '18499190 ' to parameter: 8
19:55:42,192 DEBUG IntegerType:46 - binding '20090103' to parameter: 9
19:55:42,192 DEBUG StringType:46 - binding '422940' to parameter: 10
19:55:42,192 DEBUG BatcherImpl:28 - Adding to batch
19:55:42,192 DEBUG BatcherImpl:50 - Executing batch size: 1
apres que mon code passe sur tx.commit
il sort du programmeur. ET rien de passe.
Pas de uptade et il ne va jamais sur l instruction suivance.
J ai place des Exceptions pour essaye de de l attache
mais c est pas possible
Code:
HibernateUtil.closeSession();