[Castore-commits] JDOUserEventFactory.java 1.20 1.21

mathieu grimault grimault-m at adullact1.hosting.cri74.org
Jeu 14 Déc 11:25:36 CET 2006


Update of /cvsroot/castore/castore-core/src/java/fr/emn/castor/users/jdo
In directory adullact1:/tmp/cvs-serv22355/src/java/fr/emn/castor/users/jdo

Modified Files:
	JDOUserEventFactory.java 
Log Message:
Annulation dans castore.
Le thread de retro est mise en attente jusqu'a la fin de soumission.

Index: JDOUserEventFactory.java
===================================================================
RCS file: /cvsroot/castore/castore-core/src/java/fr/emn/castor/users/jdo/JDOUserEventFactory.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** JDOUserEventFactory.java	2 Oct 2006 14:06:25 -0000	1.20
--- JDOUserEventFactory.java	14 Dec 2006 10:25:33 -0000	1.21
***************
*** 291,318 ****
          String userId = fr.emn.castor.documents.Facade
              .getInstance().getSoumetteurName(idDoc);
!         PersistenceManager pm = JDOFactory.getPersistenceManager();
!         UserProfil userProfil = this.getUserProfil(pm, userId);
!         Transaction tx = pm.currentTransaction();
!         try {
!             tx.begin();
!             userProfil.removeDocFromAllCollection(idDoc);
!             userProfil.removeDocLus(idDoc);
!             tx.commit();
!         } catch (Exception e) {
!             if (log.isErrorEnabled()) {
!                 log.error(e.getMessage(), e);
!             }
!             if (log.isDebugEnabled()) {
!                 log.debug("Failed.");
!             }
!             throw new UsersException(e.getMessage());
!         } finally {
!             if (tx.isActive()) {
!                 tx.rollback();
!             }
!             pm.close();
!             if (log.isDebugEnabled()) {
!                 log.debug("End of addNewSuppressionDoc.");
!             }
          }
      }
--- 291,320 ----
          String userId = fr.emn.castor.documents.Facade
              .getInstance().getSoumetteurName(idDoc);
!         if (userId != null) {
! 		    PersistenceManager pm = JDOFactory.getPersistenceManager();
! 		    UserProfil userProfil = this.getUserProfil(pm, userId);
! 		    Transaction tx = pm.currentTransaction();
! 		    try {
! 		        tx.begin();
! 		        userProfil.removeDocFromAllCollection(idDoc);
! 		        userProfil.removeDocLus(idDoc);
! 		        tx.commit();
! 		    } catch (Exception e) {
! 		        if (log.isErrorEnabled()) {
! 		            log.error(e.getMessage(), e);
! 		        }
! 		        if (log.isDebugEnabled()) {
! 		            log.debug("Failed.");
! 		        }
! 		        throw new UsersException(e.getMessage());
! 		    } finally {
! 		        if (tx.isActive()) {
! 		            tx.rollback();
! 		        }
! 		        pm.close();
! 		        if (log.isDebugEnabled()) {
! 		            log.debug("End of addNewSuppressionDoc.");
! 		        }
! 		    }
          }
      }




Plus d'informations sur la liste de diffusion Castore-commits