continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r693345 - in /continuum/branches/continuum-transient-state: continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/ continuum-model/src/main/mdo/
Date Tue, 09 Sep 2008 02:22:03 GMT
Author: ctan
Date: Mon Sep  8 19:22:03 2008
New Revision: 693345

URL: http://svn.apache.org/viewvc?rev=693345&view=rev
Log:
fixed state of projectscmroot if continuum is killed while preparing the build 

Modified:
    continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-transient-state/continuum-model/src/main/mdo/continuum.xml

Modified: continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=693345&r1=693344&r2=693345&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Mon Sep  8 19:22:03 2008
@@ -3021,6 +3021,27 @@
             getLogger().info( " " + project.getId() + ":" + project.getName() + ":" + project.getVersion()
+ ":" +
                 project.getExecutorId() );
         }
+
+        for ( ProjectScmRoot projectScmRoot : projectScmRootDao.getAllProjectScmRoots() )
+        {
+            if ( projectScmRoot.getState() == ContinuumProjectState.UPDATING )
+            {
+                projectScmRoot.setState( projectScmRoot.getOldState() );
+
+                projectScmRoot.setOldState( 0 );
+
+                try
+                {
+                    getLogger().info( "Fix state for projectScmRoot " + projectScmRoot.getScmRootAddress()
);
+                    
+                    projectScmRootDao.updateProjectScmRoot( projectScmRoot );
+                }
+                catch ( ContinuumStoreException e )
+                {
+                    throw new InitializationException( "Database is corrupted.", e );
+                }
+            }
+        }
     }
 
     // --------------------------------

Modified: continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java?rev=693345&r1=693344&r2=693345&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
(original)
+++ continuum/branches/continuum-transient-state/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
Mon Sep  8 19:22:03 2008
@@ -216,10 +216,11 @@
         throws TaskExecutionException
     {
         ProjectScmRoot projectScmRoot = AbstractContinuumAction.getProjectScmRoot( context
);
-        if ( !( projectScmRoot.getState() == ContinuumProjectState.UPDATING ) )
+        if ( projectScmRoot.getState() != ContinuumProjectState.UPDATING )
         {
             try
             {
+                projectScmRoot.setOldState( projectScmRoot.getState() );
                 projectScmRoot.setState( ContinuumProjectState.UPDATING );
                 projectScmRootDao.updateProjectScmRoot( projectScmRoot );
             }

Modified: continuum/branches/continuum-transient-state/continuum-model/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-transient-state/continuum-model/src/main/mdo/continuum.xml?rev=693345&r1=693344&r2=693345&view=diff
==============================================================================
--- continuum/branches/continuum-transient-state/continuum-model/src/main/mdo/continuum.xml
(original)
+++ continuum/branches/continuum-transient-state/continuum-model/src/main/mdo/continuum.xml
Mon Sep  8 19:22:03 2008
@@ -1498,6 +1498,11 @@
           <type>String</type>
           <required>true</required>
         </field>
+        <field>
+          <name>oldState</name>
+          <version>1.1.2+</version>
+          <type>int</type>
+        </field>
         <field jpox.column="scmRootState">
           <name>state</name>
           <version>1.1.2+</version>



Mime
View raw message