continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r620611 - /maven/continuum/branches/continuum-1.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Mon, 11 Feb 2008 21:12:45 GMT
Author: evenisse
Date: Mon Feb 11 13:12:43 2008
New Revision: 620611

URL: http://svn.apache.org/viewvc?rev=620611&view=rev
Log:
[CONTINUUM-1630] Fix possible sql errors during projects deletes

Modified:
    maven/continuum/branches/continuum-1.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: maven/continuum/branches/continuum-1.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-1.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=620611&r1=620610&r2=620611&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/branches/continuum-1.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Feb 11 13:12:43 2008
@@ -716,7 +716,10 @@
             for ( Object o : project.getBuildResults() )
             {
                 BuildResult br = (BuildResult) o;
-                store.removeBuildResult( br );
+                //Remove all modified dependencies to prevent SQL errors
+                br.setModifiedDependencies( null );
+                store.updateBuildResult( br );
+                removeBuildResult( br );
             }
 
             File workingDirectory = getWorkingDirectory( projectId );
@@ -1189,19 +1192,27 @@
         throws ContinuumException
     {
         BuildResult buildResult = getBuildResult( buildId );
+        removeBuildResult( buildResult );
+    }
+
+
+    private void removeBuildResult( BuildResult buildResult )
+        throws ContinuumException
+    {
         store.removeBuildResult( buildResult );
 
         // cleanup some files
         try
         {
             File buildOutputDirectory = getConfiguration().getBuildOutputDirectory( buildResult.getProject().getId()
);
-            File buildDirectory = new File( buildOutputDirectory, Integer.toString( buildId
) );
+            File buildDirectory = new File( buildOutputDirectory, Integer.toString( buildResult.getId()
) );
 
             if ( buildDirectory.exists() )
             {
                 FileUtils.deleteDirectory( buildDirectory );
             }
-            File buildOutputFile = getConfiguration().getBuildOutputFile( buildId, buildResult.getProject().getId()
);
+            File buildOutputFile =
+                getConfiguration().getBuildOutputFile( buildResult.getId(), buildResult.getProject().getId()
);
             if ( buildOutputFile.exists() )
             {
                 buildOutputFile.delete();



Mime
View raw message