public static function executeScript($file, $initSection) {
    $logger = LogManager::getLogger(__CLASS__);
    if (file_exists($file)) {
      $logger->info('Executing SQL script '.$file.' ...');

      // find init params
      $config = ObjectFactory::getInstance('configuration');
      if (($connectionParams = $config->getSection($initSection)) === false) {
        throw new ConfigurationException("No '".$initSection."' section given in configfile.");
      }
      // connect to the database
      $conn = self::createConnection($connectionParams);

      $logger->debug('Starting transaction ...');
      $conn->beginTransaction();

      $exception = null;
      $fh = fopen($file, 'r');
      if ($fh) {
        while (!feof($fh)) {
          $command = fgets($fh, 8192);
          if (strlen(trim($command)) > 0) {
            $logger->debug('Executing command: '.preg_replace('/[\n]+$/', '', $command));
            try {
              $conn->query($command);
            }
            catch(\Exception $ex) {
              $exception = $ex;
              break;
            }
          }
        }
        fclose($fh);
      }
      if ($exception == null) {
        $logger->debug('Execution succeeded, committing ...');
        $conn->commit();
      }
      else {
        $logger->error('Execution failed. Reason'.$exception->getMessage());
        $logger->debug('Rolling back ...');
        $conn->rollBack();
      }
      $logger->debug('Finished SQL script '.$file.'.');
    }
    else {
      $logger->error('SQL script '.$file.' not found.');
    }
  }