Ejemplo n.º 1
0
  /*
   * (non-Javadoc)
   *
   * @see org.postgresql.stado.Engine.IExecutable#execute(org.postgresql.stado.Engine.Engine)
   */
  public ExecutionResult execute(Engine engine) throws Exception {
    final String method = "execute";
    logger.entering(method, new Object[] {engine});
    try {

      if (!isPrepared()) {
        prepare();
      }
      XDBSessionContext newClient = XDBSessionContext.createSession();
      try {
        for (String element : dbListStr) {
          newClient.useDB(element, MessageTypes.CONNECTION_MODE_ADMIN);
          newClient.login(client.getCurrentUser().getLogin());
          newClient.startDatabase(timeout);
        }

      } finally {
        newClient.logout();
      }

    } finally {
      logger.exiting(method);
    }
    return ExecutionResult.createSuccessResult(ExecutionResult.COMMAND_START_DATABASE);
  }
Ejemplo n.º 2
0
 public ExecutionResult execute(Engine engine) throws Exception {
   if (!isPrepared()) {
     prepare();
   }
   SyncDropView sync = new SyncDropView(this);
   MetaData meta = MetaData.getMetaData();
   meta.beginTransaction();
   try {
     sync.execute(client);
     meta.commitTransaction(sync);
   } catch (Exception e) {
     logger.catching(e);
     meta.rollbackTransaction();
     throw e;
   }
   return ExecutionResult.createSuccessResult(ExecutionResult.COMMAND_DROP_VIEW);
 }