Starts up the database, using the data directory and port specified in the configuration.

@throws ManagedProcessException if something fatal went wrong
972031
public synchronized void start() throws ManagedProcessException {
        logger.info("Starting up the database...");
        boolean ready = false;
        try {
            mysqldProcess = startPreparation();
            ready = mysqldProcess.startAndWaitForConsoleMessageMaxMs(getReadyForConnectionsTag(), dbStartMaxWaitInMS);
        } catch (Exception e) {
            logger.error("failed to start mysqld", e);
            throw new ManagedProcessException("An error occurred while starting the database", e);
        }
        if (!ready) {
            if (mysqldProcess.isAlive())
                mysqldProcess.destroy();
            throw new ManagedProcessException("Database does not seem to have started up correctly? Magic string not seen in "
                    + dbStartMaxWaitInMS + "ms: " + getReadyForConnectionsTag() + mysqldProcess.getLastConsoleLines());
        }
        logger.info("Database startup complete.");
    }
411583
@Validate
    public void start() {
        Configuration conf = configuration.getConfiguration("pools");

        createExecutor(ManagedExecutorService.SYSTEM,
                conf != null ? conf.getConfiguration("executors." + ManagedExecutorService.SYSTEM) : null);
        createScheduler(ManagedScheduledExecutorService.SYSTEM,
                conf != null ? conf.getConfiguration("schedulers." + ManagedScheduledExecutorService.SYSTEM) : null);

        if (conf != null) {
            createOtherExecutors(conf.getConfiguration("executors"));
            createOtherSchedulers(conf.getConfiguration("schedulers"));
        }
    }
768153
private function runMigration()
    {
        // Confirm connection and migration.
        $connection = $this->confirmConnectionAndMigration();

        // Load the migration class.
        $migration_class = $this->getMigrationClass();

        // Process the migration.
        $this->processMigration($connection, $migration_class);

        // Save this migration to the database/migrations folder.
        $this->createMigrationFile($connection, $migration_class);
    }
265813
private function ensureProcessIsStarted(): void
    {
        if (is_resource($this->process) === false) {
            $this->startProcess();

            $this->handleStartupErrors();
        }
    }
876073
public void start() throws PersistenceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start");

        String logFileName        = null;
        String permanentStoreFileName = null;
        String temporaryStoreFileName = null;

        String logFileProperty = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_NAME,
                                                 MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_NAME_DEFAULT);
        String logPrefix       = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_PREFIX,
                                                 _configuration.getObjectManagerLogDirectory());
        String logSizeStr      = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_LOG_FILE_SIZE, null);

        long logSize = _configuration.getObjectManagerLogSize();
        if (logSizeStr != null) logSize = Long.parseLong(logSizeStr);

        // Permanent Object Store properties
        String permanentStoreProperty       = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_NAME,
                                                              MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_NAME_DEFAULT);
        String permanentStorePrefix         = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_PREFIX,
                                                              _configuration.getObjectManagerPermanentStoreDirectory());

        // Temporary Object Store properties
        String temporaryStoreProperty       = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_NAME,
                                                              MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_NAME_DEFAULT);
        String temporaryStorePrefix         = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_PREFIX,
                                                              _configuration.getObjectManagerTemporaryStoreDirectory());
        // 727994
        // Set _hasRedeliveryCountColumn to true because unlike datastore where we
        // check if redelivery count column exist or not we dont have to do the
        // same check for filestore as that column will be automatically available
        // depending upon the version of WAS
        // Persisting RedeliveryCount feature was introduced from WAS v8.5 onwards
        _ms.setRedeliveryCountColumn(true);

        // Defect 496893
        // First we need to start up our ObjectManager instance. We will retry this
        // for a pre-determined time period in order to allow for connectivity problems
        // to the file store files.
        boolean connected = false;
        long   retryLimit = System.currentTimeMillis() + _timeouts.getRetryTimeLimit();
        // Defect 549131
        // Set our starting flag so that we can detect if we are asked to 
        // stop while attempting to start the ObjectManager.
        _starting = true;
        do
        {
            // The directory creation needs to be in the retry loop as if we can't connect
            // once then the directory would never get created and may cause us to fail to
            // find our path even if the disc is available.
            logPrefix = createDirectoryPath(logPrefix);

            if (logPrefix.endsWith(File.separator))
            {
                logFileName = logPrefix+logFileProperty;
            }
            else
            {
                logFileName = logPrefix+File.separator+logFileProperty;
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { 
            	SibTr.debug(this, tc, "User directory for ObjectManager log file defined: "+logPrefix);
            	SibTr.debug(this, tc, "The file store is attempting to initalise its log file:" + logFileName);
            }

            // As we do not know earlier whether we have access to our file system we need to do
            // our path name creation at this point. It still does not save us if our store
            // files and log file are on completely seperately network accessible locations
            // but it is slightly safer than doing it before the log starts up.
            permanentStorePrefix = createDirectoryPath(permanentStorePrefix);
            temporaryStorePrefix = createDirectoryPath(temporaryStorePrefix);

            // Figure out the real file names where we expect to find the permanent and temporary stores.
            // We use them to build the ObjectStoreLocations map to pass into the ObjectManager.
            if (permanentStorePrefix.endsWith(File.separator))
            {
                permanentStoreFileName = permanentStorePrefix+permanentStoreProperty;
            }
            else
            {
                permanentStoreFileName = permanentStorePrefix+File.separator+permanentStoreProperty;
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Filename for ObjectManager permanent store is: "+permanentStoreFileName);

            if (temporaryStorePrefix.endsWith(File.separator))
            {
                temporaryStoreFileName = temporaryStorePrefix+temporaryStoreProperty;
            }
            else
            {
                temporaryStoreFileName = temporaryStorePrefix+File.separator+temporaryStoreProperty;
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Filename for ObjectManager temporary store is: "+temporaryStoreFileName);

            // Populate the Map of ObjectStoreLocations
            storeLocations.put(PERMANENT_STORE_NAME, permanentStoreFileName);
            storeLocations.put(TEMPORARY_STORE_NAME, temporaryStoreFileName);

            try
            {
                // Defect 549131
                // Synchronize with the stop thread at this point so that one 
                // of two things happen:
                //  1) The stop thread gets in first. We need to avoid starting an object
                //     manager altogether.
                //  2) The start thread gets in first. The stop thread needs to wait so
                //     that its stop processing has the handle to the objectmanager to 
                //     call stop on.
                synchronized(this)
                {
                    if (_starting)
                    {
                        // Do we need to start from an empty file store or can
                        // we startup using an existing set of data?
                        // Either way, we need to register ourselves for any event callbacks.
                        if (_configuration.isCleanPersistenceOnStart())
                        {
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Clean starting the Persistence Layer.");
        
                            _objectManager = new ObjectManager(logFileName, ObjectManager.LOG_FILE_TYPE_CLEAR, storeLocations, new ObjectManagerEventCallback[]{this});
                        }
                        else
                        {
                            _objectManager = new ObjectManager(logFileName, ObjectManager.LOG_FILE_TYPE_FILE, storeLocations, new ObjectManagerEventCallback[]{this});
                        }

                        connected = true;
                    }
                }

            }
            catch (PermanentIOException pioe)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(pioe, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:397:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unable to start ObjectManager instance!", pioe);
                SibTr.error(tc, "FILE_STORE_UNEXPECTED_IO_EXCEPTION_SIMS1592");
                // This will drop through to the retry wait below.
            }
            catch (LogFileInUseException lfiue)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(lfiue, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:404:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unable to start ObjectManager instance!", lfiue);
                SibTr.error(tc, "FILE_STORE_LOG_FILE_IN_USE_SIMS1579");
                // This will drop through to the retry wait below.
            }
            catch (NonExistentLogFileException nelfe)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(nelfe, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:411:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unable to start ObjectManager instance!", nelfe);
                SibTr.error(tc, "FILE_STORE_CANNOT_FIND_LOG_FILE_SIMS1580", logFileName);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                throw new SeverePersistenceException("Unable to locate the file path: " + nelfe.getMessage(), nelfe);
            }
            catch (ObjectManagerException ome)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:418:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected exception caught initializing file store!", ome);
                SibTr.error(tc, "FILE_STORE_UNEXPECTED_INITIALISATION_EXCEPTION_SIMS1591");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                throw new SeverePersistenceException("Unexpected exception caught initializing file store: "+ome.getMessage(), ome);
            }

            // Defect 549131
            // Only go into the retry wait if we are still starting
            if (!connected && _starting)
            {
                // Have we taken longer to create the ObjectManager than our alloted
                // retry period?
                long currentTime = System.currentTimeMillis();
                if (currentTime < retryLimit)
                {
                    SibTr.info(tc, "FILE_STORE_PROBLEM_INITIALISING_LOG_SIMS1582");

                    // If we still have time to retry then we need to wait a while to
                    // avoid a hot loop and then try again.
                    try
                    {
                        synchronized(this)
                        {
                            wait(_timeouts.getRetryWaitTime());
                        }
                    }
                    catch (InterruptedException ie)
                    {
                        // No FFDC Code Needed.
                    }
                }
                else
                {
                    SibTr.error(tc, "FILE_STORE_INITIALISATION_RETRY_LIMIT_EXCEEDED_SIMS1583");

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                    throw new SeverePersistenceException("Retry time limit reached when starting file store!");
                }
            }
        // Defect 549131
        // If we were already waiting when the stop request came in our
        // notify should pop us out at which point this check will drop
        // us out of the while loop.
        } while (!connected && _starting); 

        // Defect 549131
        // Carry on starting up only if we have not been asked to stop.
        if (_starting)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "The file store has initialised successfully.");
    
            // Note that the the OMgr is now up and running, so we do care if it stops
            _omgrStarted = true;
    
            // Now we need to open our ObjectStores and find our Anchor object.
            // Figure out the size properties
            // Permanent Object Store properties
            String minimumPermanentStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_MINIMUM_SIZE, null);
            String maximumPermanentStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_FILE_MAXIMUM_SIZE, null);
    
            long minimumPermanentStoreSize = _configuration.getObjectManagerMinimumPermanentStoreSize();
            if (minimumPermanentStoreSizeStr != null) minimumPermanentStoreSize = Long.parseLong(minimumPermanentStoreSizeStr);
            long maximumPermanentStoreSize = _configuration.getObjectManagerMaximumPermanentStoreSize();
            if (maximumPermanentStoreSizeStr != null) maximumPermanentStoreSize = Long.parseLong(maximumPermanentStoreSizeStr);
    
            boolean isPermanentStoreSizeUnlimited = _configuration.isObjectManagerPermanentStoreSizeUnlimited();
    
            // Temporary Object Store properties
            String minimumTemporaryStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_MINIMUM_SIZE, null);
            String maximumTemporaryStoreSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_FILE_MAXIMUM_SIZE, null);
    
            long minimumTemporaryStoreSize = _configuration.getObjectManagerMinimumTemporaryStoreSize();
            if (minimumTemporaryStoreSizeStr != null) minimumTemporaryStoreSize = Long.parseLong(minimumTemporaryStoreSizeStr);
            long maximumTemporaryStoreSize = _configuration.getObjectManagerMaximumTemporaryStoreSize();
            if (maximumTemporaryStoreSizeStr != null) maximumTemporaryStoreSize = Long.parseLong(maximumTemporaryStoreSizeStr);
    
            boolean isTemporaryStoreSizeUnlimited = _configuration.isObjectManagerTemporaryStoreSizeUnlimited();

            // common properties
            String storeFullWaitForCheckPointStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_STORE_FULL_WAIT_FOR_CHECKPOINT,
                                                                   MessageStoreConstants.PROP_OBJECT_MANAGER_STORE_FULL_WAIT_FOR_CHECKPOINT_DEFAULT);
            boolean storeFullWaitForCheckPoint = Boolean.parseBoolean(storeFullWaitForCheckPointStr);


            // Defect 533310
            // Read the object store object cache size properties
            String permanentStoreObjectCacheSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_CACHE_SIZE, 
                                                                      MessageStoreConstants.PROP_OBJECT_MANAGER_PERMANENT_STORE_CACHE_SIZE_DEFAULT);
    
            int permanentStoreObjectCacheSize = Integer.parseInt(permanentStoreObjectCacheSizeStr);
    
            String temporaryStoreObjectCacheSizeStr = _ms.getProperty(MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_CACHE_SIZE, 
                                                                      MessageStoreConstants.PROP_OBJECT_MANAGER_TEMPORARY_STORE_CACHE_SIZE_DEFAULT);
    
            int temporaryStoreObjectCacheSize = Integer.parseInt(temporaryStoreObjectCacheSizeStr);
    
            Transaction transaction = null;
    
            try
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "The file store is attempting to start its permanent store (" + PERMANENT_STORE_NAME + ") and temporary store (" + TEMPORARY_STORE_NAME + ")");
    
                // Defect 298902
                // If we are warm started then we should find an existing
                // set of object stores. If we are cold started then we
                // need to create them.
                if (_objectManager.warmStarted())
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Object Manager Warm Started");
    
                    try
                    {
                        // If we have an 'oldPermanentStoreName' we'll need to open that
                        // and rename it, otherwise we just open the 'proper' name.
                        if (oldPermanentStore == null)
                        {
                            _permanentStore = _objectManager.getObjectStore(PERMANENT_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Permanent Store Found");
                        }
                        else
                        {
                            _permanentStore = _objectManager.getObjectStore(oldPermanentStore);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Permanent Store Found");
                            _permanentStore.setName(PERMANENT_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Permanent Store Renamed");
                        }
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "The file stores permanent store has been started successfully.");
    
                        // If we have an 'oldTemporaryStoreName' we'll need to open that
                        // and rename it, otherwise we just open the 'proper' name.
                        if (oldTemporaryStore == null)
                        {
                            _temporaryStore = _objectManager.getObjectStore(TEMPORARY_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Temporary Store Found");
                        }
                        else
                        {
                            _temporaryStore = _objectManager.getObjectStore(oldTemporaryStore);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Temporary Store Found");
                            _temporaryStore.setName(TEMPORARY_STORE_NAME);
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Old Temporary Store Renamed");
                        }

                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                            SibTr.debug(this, tc, "The file stores temporary store has been started successfully.");
    
                        // Set the size of our files.
                        setFileSizesAfterRestart(false,
                                                 minimumPermanentStoreSize, maximumPermanentStoreSize, isPermanentStoreSizeUnlimited,
                                                 minimumTemporaryStoreSize, maximumTemporaryStoreSize, isTemporaryStoreSizeUnlimited,
                                                 logSize);
                    }
                    catch (UnknownObjectStoreException uose)
                    {
                        com.ibm.ws.ffdc.FFDCFilter.processException(uose, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:572:1.81.1.6", this);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "ObjectStore not found after warm start!", uose);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                        throw new SeverePersistenceException("ObjectStore not found after warm start!");
                    }
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Object Manager Cold Started");
    
                    // Create the permanent store.
                    _permanentStore = new SingleFileObjectStore(PERMANENT_STORE_NAME, _objectManager, ObjectStore.STRATEGY_KEEP_ALWAYS);
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    	SibTr.debug(this, tc, "The file stores permanent store has been started successfully.");
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Permanent Store Created");
    
                    // Create the temporary store.                                        // Defect 291558, empty this store on restart
                    _temporaryStore = new SingleFileObjectStore(TEMPORARY_STORE_NAME, _objectManager, ObjectStore.STRATEGY_KEEP_UNTIL_NEXT_OPEN);
                    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    	SibTr.debug(this, tc, "The file stores temporary store has been started successfully.");
                    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Temporary Store Created");
    
                    // Set the size of our files.
                    setFileSizesAfterRestart(true,
                                             minimumPermanentStoreSize, maximumPermanentStoreSize, isPermanentStoreSizeUnlimited,
                                             minimumTemporaryStoreSize, maximumTemporaryStoreSize, isTemporaryStoreSizeUnlimited,
                                             logSize);
                }

                // set the storeFullWaitForCheckpoint property
                _permanentStore.setStoreFullWaitForCheckPoint(storeFullWaitForCheckPoint);
                _temporaryStore.setStoreFullWaitForCheckPoint(storeFullWaitForCheckPoint);

                // Defect 533310
                // Set the cache sizes on the object stores
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Permanent store object cache size set to: "+permanentStoreObjectCacheSize);
                ((SingleFileObjectStore)_permanentStore).setCachedManagedObjectsSize(permanentStoreObjectCacheSize);
    
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Temporary store object cache size set to: "+temporaryStoreObjectCacheSize);
                ((SingleFileObjectStore)_temporaryStore).setCachedManagedObjectsSize(temporaryStoreObjectCacheSize);
    
    
                // Once we have our ObjectStore references we now need our
                // Anchor object. If we have cold started or done a clean warm
                // start then we need to create the Anchor. If not we should
                // find it in the ObjectManager.
                _anchorToken = _objectManager.getNamedObject("Anchor", null);
    
                if (_anchorToken != null)
                {
                    _anchor = (Anchor)_anchorToken.getManagedObject();
    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Stored Anchor Found");
                }
                else
                {
                    // If we didn't manage to create the Anchor last time
                    // then we need to do it now.
                    transaction = _objectManager.getTransaction();
    
                    // Create and allocate a new Anchor.
                    _anchor      = new Anchor();
                    _anchorToken = _permanentStore.allocate(_anchor);
    
                    // Add Anchor to transaction.
                    transaction.add(_anchor);
    
                    // Add Anchor's token to the ObjectManager as a named object.
                    _objectManager.putNamedObject("Anchor", _anchorToken, transaction);
    
                    transaction.commit(false);
    
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Stored Anchor Created");
                }
            }
            catch (ObjectManagerException ome)
            {
                com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:647:1.81.1.6", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Unexpected exception caught starting permanent and temporary stores!", ome);
    
                if (transaction != null)
                {
                    try
                    {
                        // Clean up our ObjectManager work.
                        transaction.backout(false);
                    }
                    catch (ObjectManagerException e)
                    {
                        com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.start", "1:659:1.81.1.6", this);
                        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception caught backing out persistent message store startup work!", e);
                    }
                }
    
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
                throw new SeverePersistenceException("Unexpected exception caught starting permanent and temporary stores: "+ome.getMessage(), ome);
            }
    
            // Check the ME_UUID and update our INC_UUID.
            // If we are successful then carry on with startup.
            if (checkAndUpdateMEOwner(_meOwner))
            {
                // Start the unique key generator manager.
                _uniqueKeyManager.start(_anchor, _objectManager, _permanentStore);
    
                // Defect 530772
                // Create the batching context factory.
                _batchingContextFactory = new BatchingContextFactoryImpl(_objectManager, _temporaryStore);
    
                // Create and start the spill dispatcher.
                _spillDispatcher = new SpillDispatcher(_ms, _batchingContextFactory);
                _spillDispatcher.start();
    
                // Defect 363755
                // Only become available once we have finished starting.
                _available = true;
                
                if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(this, tc, "The file store has started successfully.");
            }
        } // if (_starting)
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Startup processing halted as a stop was requested!");
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
            throw new PersistenceException("Startup processing halted as a stop was requested!");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
    }
916954
public void start() {
		if (state.compareAndSet(UNKNOWN, STARTING)){
			log.debug("Starting...");
			if ( (StringUtils.isBlank(startSqlCondition) || isInCondition(startSqlCondition))
					&& (StringUtils.isBlank(startSqlConditionResource) || isInConditionResource(startSqlConditionResource))
					){
				if (StringUtils.isNotBlank(startSQL)){
					executeSQL(startSQL);
				} else if (StringUtils.isNotBlank(startSqlResource)){
					executeSqlResource(startSqlResource);
				}
			}
			state.set(RUNNING);
		}else{
			log.warn("Start request ignored. Current state is: " + stateNames[state.get()]);
		}
	}
1331429
private void init() {
    host = DEFAULT_HOST;
    port = DEFAULT_PORT;
    database = DEFAULT_DATABASE;
    user = DEFAULT_USER;
    password = DEFAULT_PASSWORD;
    cachePreparedStatements = DEFAULT_CACHE_PREPARED_STATEMENTS;
    pipeliningLimit = DEFAULT_PIPELINING_LIMIT;
    sslMode = DEFAULT_SSLMODE;
  }
1034229
public void start() {
		eb = vertx.eventBus();
		config = config();
		FileResolver.getInstance().setBasePath(config);
	}
305863
private function launch()
    {
        $string = $this->configurator->getConnectionString();
        $handler = pg_connect($string, \PGSQL_CONNECT_FORCE_NEW);

        if ($handler === false) {
            throw new ConnectionException(
                sprintf(
                    "Error connecting to the database with parameters '%s'.",
                    preg_replace('/password=[^ ]+/', 'password=xxxx', $string)
                )
            );
        } else {
            $this->handler = $handler;
        }

        if ($this->getConnectionStatus() !== static::CONNECTION_STATUS_GOOD) {
            throw new ConnectionException(
                "Connection open but in a bad state. Read your database server log to learn more about this."
            );
        }

        $this->sendConfiguration();

        return $this;
    }
1262172
protected void prepareDirectories() throws ManagedProcessException {
        baseDir = Util.getDirectory(configuration.getBaseDir());
        libDir = Util.getDirectory(configuration.getLibDir());
        try {
            String dataDirPath = configuration.getDataDir();
            if (Util.isTemporaryDirectory(dataDirPath)) {
                FileUtils.deleteDirectory(new File(dataDirPath));
            }
            dataDir = Util.getDirectory(dataDirPath);
        } catch (Exception e) {
            throw new ManagedProcessException("An error occurred while preparing the data directory", e);
        }
    }
85225
public function start():void {
		$server = new ServerInfo($_SERVER);

		$cwd = dirname($server->getDocumentRoot());
		chdir($cwd);

		$config = ConfigFactory::createForProject(
			$cwd,
			implode(DIRECTORY_SEPARATOR, [
				dirname(__DIR__),
				"config.default.ini",
			])
		);

		$input = new Input($_GET, $_POST, $_FILES);
		$cookie = new CookieHandler($_COOKIE);

		$sessionHandler = SessionSetup::attachHandler(
			$config->get("session.handler")
		);
		$sessionConfig = $config->getSection("session");
		$sessionId = $cookie[$sessionConfig["name"]];
		$sessionHandler = new Session(
			$sessionHandler,
			$sessionConfig,
			$sessionId
		);

		$databaseSettings = new Settings(
			$config->get("database.query_directory"),
			$config->get("database.driver"),
			$config->get("database.schema"),
			$config->get("database.host"),
			$config->get("database.port"),
			$config->get("database.username"),
			$config->get("database.password")
		);
		$database = new Database($databaseSettings);

		$this->protectGlobals();
		$this->attachAutoloaders(
			$server->getDocumentRoot(),
			$config->getSection("app")
		);

		$request = $this->createServerRequest(
			$server,
			$input,
			$cookie
		);

		$router = $this->createRouter(
			$request,
			$server->getDocumentRoot()
		);

		$csrfProtection = new SessionTokenStore(
			$sessionHandler->getStore(
				"gt.csrf",
			true
			)
		);
		$csrfProtection->processAndVerify(
			$input->getAll(Input::DATA_BODY)
		);

		$dispatcher = $this->createDispatcher(
			$config,
			$server,
			$input,
			$cookie,
			$sessionHandler,
			$database,
			$router,
			$csrfProtection
		);

		$response = $this->process($request, $dispatcher);
		$this->finish($response);
	}
207118
public void startUp() throws Exception {
    logger.info(String.format("Starting RPC server on port %d", port));
    ServerBootstrap bootstrap = new ServerBootstrap();

    ChannelFuture futureChannel = bootstrap.group(parentGroup, childGroup)
        .channel(channelClass)
        .childHandler(channelInitializer())
        .bind(port)
        .awaitUninterruptibly();

    if (futureChannel.isSuccess()) {
      this.channel = futureChannel.channel();
      logger.info("RPC server started successfully.");
    } else {
      logger.info("Failed to start RPC server.");
      throw new Exception(futureChannel.cause());
    }
  }
1315223
public function start()
    {
        $this->sendMeta($this->report->dataStore($this->storeName)->meta());
        $this->startInput(null);
        $this->report->dataStore($this->storeName)->popStart();
        while ($row = $this->report->dataStore($this->storeName)->pop()) {
            $this->next($row, $this);
        }
        $this->endInput(null);
    }
710918
public function runAction()
    {
        try {
            $this->commandBus->dispatch(CreateDefaultProcessingConfigFile::in(ConfigLocation::fromPath(Definition::getSystemConfigDir())));

            $sqliteDbFile = SqliteDbFile::initializeFromDist(Definition::getEventStoreSqliteDbFile());

            $esConfigLocation = ConfigLocation::fromPath(Definition::getSystemConfigDir());

            $this->commandBus->dispatch(InitializeEventStore::setUpWithSqliteDbAdapter($sqliteDbFile, $esConfigLocation));

        } catch (\Exception $ex) {
            $this->commandBus->dispatch(UndoSystemSetUp::removeConfigs(
                Definition::getSystemConfigDir(),
                Definition::getSystemConfigDir(),
                Definition::getEventStoreSqliteDbFile()
            ));

            throw $ex;
        }

        return $this->redirect()->toRoute('prooph.link/system_config');
    }
1054929
public void start()
    {
        if (!state.compareAndSet(State.LATENT, State.STARTING)) {
            throw new IllegalStateException("System already starting");
        }
        for (LifeCycleListener listener : listeners) {
            listener.startingLifeCycle();
        }

        for (Object obj : managedInstances) {
            LifeCycleMethods methods = methodsMap.get(obj.getClass());
            if (!methods.hasFor(PreDestroy.class)) {
                managedInstances.remove(obj);   // remove reference to instances that aren't needed anymore
            }
        }

        state.set(State.STARTED);
        for (LifeCycleListener listener : listeners) {
            listener.startedLifeCycle();
        }
    }
666674
public function start()
    {
        $metaData = array("columns"=>array());

        if ($this->countTotal) {
            $totalQuery = $this->bindParams($this->totalQuery, $this->sqlParams);
            $totalResult = $this->connection->query($totalQuery);
            if ($totalResult===false) {
                throw new \Exception("Error on query >>> ".$this->connection->error);
            }
            $row = $totalResult->fetch_array();
            $result = $row[0];
            $metaData['totalRecords'] = $result;
        }

        if ($this->countFilter) {
            $filterQuery = $this->bindParams($this->filterQuery, $this->sqlParams);
            $filterResult = $this->connection->query($filterQuery);
            if ($filterResult===false) {
                throw new \Exception("Error on query >>> ".$this->connection->error);
            }
            $row = $filterResult->fetch_array();
            $result = $row[0];
            $metaData['filterRecords'] = $result;
        }

        $query = $this->bindParams($this->query, $this->sqlParams);
        $result = $this->connection->query($query);
        
        if ($result===false) {
            throw new \Exception("Error on query >>> ".$this->connection->error);
        }

        $finfo = $result->fetch_fields();

        
        $numcols = count($finfo);
        for ($i=0; $i<$numcols; $i++) {
            $type = $this->mapFieldTypeToBindType($finfo[$i]->type);
                $metaData["columns"][$finfo[$i]->name] = array(
                        "type"=>$type,
                    );
            switch($type)
            {
            case "datetime":
                $metaData["columns"][$finfo[$i]->name]["format"] = "Y-m-d H:i:s";
                break;
            case "date":
                $metaData["columns"][$finfo[$i]->name]["format"] = "Y-m-d";
                break;
            case "time":
                $metaData["columns"][$finfo[$i]->name]["format"] = "H:i:s";
                break;          
            }
        }

        $this->sendMeta($metaData, $this);
    
        $this->startInput(null);
        
        while ($row = $result->fetch_assoc()) {
            $this->next($row, $this);
        }

        $this->endInput(null);
    }
1068065
public function start()
    {
        if ($this->isRunning()) {
            throw new LogicException('Process is already running');
        }

        $this->reset();

        $cmd = $this->cmd;
        if (substr($cmd, 0, 4) == 'php ') {
            $php = PHP_BINARY ?: PHP_BINDIR . '/php';
            $cmd = $php . substr($cmd, 3);
        }

        $descriptorspec = [
            0 => ['pipe', 'r'], // STDIN
            1 => ['pipe', 'w'], // STDOUT
            2 => ['pipe', 'w']  // STDERR
        ];

        $options = [
            'suppress_errors' => true,
            'binary_pipes'    => true,
        ];

        $this->process = proc_open($cmd, $descriptorspec, $this->pipes, base_path(), $this->env, $options);

        if (!is_resource($this->process)) {
            throw new RuntimeException('Unable to launch a new process.');
        }
    }