Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: transaction inactive apres un ConstraintViolationException
PostPosted: Fri Dec 03, 2010 5:29 am 
Newbie

Joined: Fri Dec 03, 2010 5:08 am
Posts: 2
Apres un ConstraintViolationException lorsque je supprime une entity de la bd. Ma transaction devient inactive. Ce qui fait que je ne peut pas faire de rollback. Par la suite toutes autres sauvegarde echoue synstematiquement.
Code:
try {
            tx.begin();
           
            deleteObject(template, errorMessage, getSession());

           tx.commit();
        } catch (Exception ex) {
            logger.error("Unable to delete allocation template: " + template.getName(), ex );
            ActionMessage error = new ActionMessage(errorMessage, false);
            errors.add(error);
        } finally {
           if (tx != null && tx.isActive()) {
                tx.rollback();
            }
        }


Quelqu'un peut - il m'aimer?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.