Package org.exoplatform.services.jcr.impl.clean.rdbms

Examples of org.exoplatform.services.jcr.impl.clean.rdbms.DBCleaner


            convertColumnIndex.add(1);
            restoreTableRule.setConvertColumnIndex(convertColumnIndex);
         }
         tables.put(dstTableName, restoreTableRule);

         DBCleaner dbCleaner = null;
         if (context.getObject(DataRestoreContext.DB_CLEANER) != null)
         {
            dbCleaner = (DBCleaner)context.getObject(DataRestoreContext.DB_CLEANER);
         }
         else
View Full Code Here


         // define one common connection for all restores and cleaners for single db case
         Connection jdbcConn = null;
        
         // define one common database cleaner for all restores for single db case
         DBCleaner dbCleaner = null;
        
         Boolean isMultiDb =
            Boolean.parseBoolean(wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.MULTIDB));

         if (!isMultiDb)
View Full Code Here

            convertColumnIndex.add(1);
            restoreTableRule.setConvertColumnIndex(convertColumnIndex);
         }
         tables.put(dstTableName, restoreTableRule);

         DBCleaner dbCleaner = null;
         if (context.getObject(DataRestoreContext.DB_CLEANER) != null)
         {
            dbCleaner = (DBCleaner)context.getObject(DataRestoreContext.DB_CLEANER);
         }
         else
View Full Code Here

            JDBCWorkspaceDataContainer.SOURCE_NAME));

      Connection conn = ds.getConnection();
      conn.setAutoCommit(false);

      DBCleaner repositoryDBCleaner = DBCleanService.getRepositoryDBCleaner(conn, repository.getConfiguration());
      try
      {
         if (repositoryName.equals("db3"))
         {
            // clean and rollback first
            repositoryDBCleaner.executeCleanScripts();
            conn.rollback();

            repositoryDBCleaner.executeRollbackScripts();
            conn.commit();

            checkConent(repositoryName);

            // clean
            repositoryDBCleaner.executeCleanScripts();
            repositoryDBCleaner.executeCommitScripts();
            conn.commit();
         }
         else
         {
            assertNull(repositoryDBCleaner);
         }
      }
      finally
      {
         conn.close();
      }

      if (repositoryName.equals("db3"))
      {
         checkEmptyTables(repositoryName);
      }

      // restore
      restore(repositoryName, bch, backupManagerImpl);
      checkConent(repositoryName);

      // clean every workspace again via DBCleaner
      repository = repositoryService.getRepository(repositoryName);
      for (WorkspaceEntry wsEntry : repository.getConfiguration().getWorkspaceEntries())
      {
         ds =
            (DataSource)new InitialContext().lookup(wsEntry.getContainer().getParameterValue(
               JDBCWorkspaceDataContainer.SOURCE_NAME));

         conn = ds.getConnection();
         conn.setAutoCommit(false);

         DBCleaner workspaceDBCleaner = DBCleanService.getWorkspaceDBCleaner(conn, wsEntry);

         try
         {
            // clean and rollback first
            workspaceDBCleaner.executeCleanScripts();
            conn.rollback();

            workspaceDBCleaner.executeRollbackScripts();
            conn.commit();

            checkConent(repositoryName);

            // clean
            workspaceDBCleaner.executeCleanScripts();
            workspaceDBCleaner.executeCommitScripts();
            conn.commit();
         }
         finally
         {
            conn.close();
View Full Code Here

            convertColumnIndex.add(1);
            restoreTableRule.setConvertColumnIndex(convertColumnIndex);
         }
         tables.put(dstTableName, restoreTableRule);

         DBCleaner dbCleaner = null;
         if (context.getObject(DataRestoreContext.DB_CLEANER) != null)
         {
            dbCleaner = (DBCleaner)context.getObject(DataRestoreContext.DB_CLEANER);
         }
         else
View Full Code Here

            convertColumnIndex.add(1);
            restoreTableRule.setConvertColumnIndex(convertColumnIndex);
         }
         tables.put(dstTableName, restoreTableRule);

         DBCleaner dbCleaner = null;
         if (context.getObject(DataRestoreContext.DB_CLEANER) != null)
         {
            dbCleaner = (DBCleaner)context.getObject(DataRestoreContext.DB_CLEANER);
         }
         else
View Full Code Here

         // define one common connection for all restores and cleaners for single db case
         Connection jdbcConn = null;
        
         // define one common database cleaner for all restores for single db case
         DBCleaner dbCleaner = null;
        
         Boolean isMultiDb =
            Boolean.parseBoolean(wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.MULTIDB));

         if (!isMultiDb)
View Full Code Here

         // define one common connection for all restores and cleaners for single db case
         Connection jdbcConn = null;
        
         // define one common database cleaner for all restores for single db case
         DBCleaner dbCleaner = null;
        
         Boolean isMultiDb =
            Boolean.parseBoolean(wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.MULTIDB));

         if (!isMultiDb)
View Full Code Here

         // define one common connection for all restores and cleaners for single db case
         Connection jdbcConn = null;
        
         // define one common database cleaner for all restores for single db case
         DBCleaner dbCleaner = null;
        
         Boolean isMultiDb =
            Boolean.parseBoolean(wsEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.MULTIDB));

         if (!isMultiDb)
View Full Code Here

            convertColumnIndex.add(1);
            restoreTableRule.setConvertColumnIndex(convertColumnIndex);
         }
         tables.put(dstTableName, restoreTableRule);

         DBCleaner dbCleaner = null;
         if (context.getObject(DataRestoreContext.DB_CLEANER) != null)
         {
            dbCleaner = (DBCleaner)context.getObject(DataRestoreContext.DB_CLEANER);
         }
         else
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.clean.rdbms.DBCleaner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.