continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r389075 - /maven/continuum/branches/continuum-1.0.x/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Date Mon, 27 Mar 2006 08:53:35 GMT
Author: evenisse
Date: Mon Mar 27 00:53:32 2006
New Revision: 389075

URL: http://svn.apache.org/viewcvs?rev=389075&view=rev
Log:
Use PlexusJdoUtils for rollback

Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java

Modified: maven/continuum/branches/continuum-1.0.x/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=389075&r1=389074&r2=389075&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
Mon Mar 27 00:53:32 2006
@@ -29,6 +29,7 @@
 import org.apache.maven.continuum.model.system.SystemConfiguration;
 import org.apache.maven.continuum.model.system.UserGroup;
 import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.jdo.PlexusJdoUtils;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 
@@ -36,7 +37,6 @@
 import javax.jdo.JDOException;
 import javax.jdo.JDOHelper;
 import javax.jdo.JDOObjectNotFoundException;
-import javax.jdo.JDOUserException;
 import javax.jdo.PersistenceManager;
 import javax.jdo.PersistenceManagerFactory;
 import javax.jdo.Query;
@@ -606,31 +606,7 @@
 
     private void rollback( Transaction tx )
     {
-        PersistenceManager pm = tx.getPersistenceManager();
-
-        try
-        {
-            if ( tx.isActive() )
-            {
-                tx.rollback();
-            }
-        }
-        finally
-        {
-            closePersistenceManager( pm );
-        }
-    }
-
-    private void closePersistenceManager( PersistenceManager pm )
-    {
-        try
-        {
-            pm.close();
-        }
-        catch ( JDOUserException e )
-        {
-            getLogger().warn( "Error while closing the persistence manager.", e );
-        }
+        PlexusJdoUtils.rollbackIfActive( tx );
     }
 
     public ProjectGroup getProjectGroup( int projectGroupId )



Mime
View raw message