/** * Return true if autoCommit mode is on. */ private boolean isAutoCommitMode() { if (serverConfig.isAutoCommitMode()) { // explicitly set return true; } DataSource dataSource = serverConfig.getDataSource(); return dataSource instanceof DataSourcePool && ((DataSourcePool) dataSource).isAutoCommit(); }
if (serverConfig.getDataSource() == null) { if (serverConfig.getDataSourceConfig().isOffline()) { c = serverConfig.getDataSource().getConnection();
if (serverConfig.getDataSource() == null) { if (serverConfig.getDataSourceConfig().isOffline()) { c = serverConfig.getDataSource().getConnection();
/** * Set the DataSource if it has not already been set. */ private void setDataSource(ServerConfig config) { if (config.getDataSource() == null) { config.setDataSource(getDataSourceFromConfig(config)); } }
if (serverConfig.getDataSource() == null) { if (serverConfig.getDataSourceConfig().isOffline()) { c = serverConfig.getDataSource().getConnection(); if (c.getAutoCommit()) { logger.warn("DataSource [{}] has autoCommit defaulting to true!", serverConfig.getName());
/** * Set the DataSource if it has not already been set. */ private void setDataSource(ServerConfig config) { if (config.getDataSource() == null) { DataSource ds = getDataSourceFromConfig(config); config.setDataSource(ds); } }
/** * Create the appropriate database specific platform. */ public DatabasePlatform create(ServerConfig serverConfig) { try { if (serverConfig.getDatabasePlatformName() != null) { // choose based on dbName return byDatabaseName(serverConfig.getDatabasePlatformName()); } if (serverConfig.getDataSourceConfig().isOffline()) { String m = "You must specify a DatabasePlatformName when you are offline"; throw new PersistenceException(m); } // guess using meta data from driver return byDataSource(serverConfig.getDataSource()); } catch (Exception ex) { throw new PersistenceException(ex); } }
/** * Set the DataSource if it has not already been set. */ private void setDataSource(ServerConfig config) { if (config.getDataSource() == null) { DataSource ds = getDataSourceFromConfig(config); config.setDataSource(ds); } }
/** * Create the appropriate database specific platform. */ public DatabasePlatform create(ServerConfig serverConfig) { try { if (serverConfig.getDatabasePlatformName() != null) { // choose based on dbName return byDatabaseName(serverConfig.getDatabasePlatformName()); } if (serverConfig.getDataSourceConfig().isOffline()) { String m = "You must specify a DatabasePlatformName when you are offline"; throw new PersistenceException(m); } // guess using meta data from driver return byDataSource(serverConfig.getDataSource()); } catch (Exception ex) { throw new PersistenceException(ex); } }
/** * Start any services after registering with the ClusterManager. */ public void start() { if (!TenantMode.DB.equals(serverConfig.getTenantMode())) { serverConfig.runDbMigration(serverConfig.getDataSource()); } }
/** * Create the appropriate database specific platform. */ public DatabasePlatform create(ServerConfig serverConfig) { try { String offlinePlatform = DbOffline.getPlatform(); if (offlinePlatform != null) { logger.info("offline platform [{}]", offlinePlatform); return byDatabaseName(offlinePlatform); } if (serverConfig.getDatabasePlatformName() != null) { // choose based on dbName return byDatabaseName(serverConfig.getDatabasePlatformName()); } if (serverConfig.getDataSourceConfig().isOffline()) { String m = "You must specify a DatabasePlatformName when you are offline"; throw new PersistenceException(m); } // guess using meta data from driver return byDataSource(serverConfig.getDataSource()); } catch (Exception ex) { throw new PersistenceException(ex); } }
/** * Return the DataSource supplier based on the tenancy mode. */ private DataSourceSupplier dataSource() { switch (serverConfig.getTenantMode()) { case DB: return new MultiTenantDbSupplier(serverConfig.getCurrentTenantProvider(), serverConfig.getTenantDataSourceProvider()); case SCHEMA: return new MultiTenantDbSchemaSupplier(serverConfig.getCurrentTenantProvider(), serverConfig.getDataSource(), serverConfig.getTenantSchemaProvider()); default: return new SimpleDataSourceProvider(serverConfig.getDataSource()); } }
this.transLogger = new TransactionLogManager(config); this.backgroundExecutor = backgroundExecutor; this.dataSource = config.getDataSource(); this.bulkEventListenerMap = new BulkEventListenerMap(config.getBulkTableEventListeners());
this.transLogger = new TransactionLogManager(config); this.backgroundExecutor = backgroundExecutor; this.dataSource = config.getDataSource(); this.bulkEventListenerMap = new BulkEventListenerMap(config.getBulkTableEventListeners());
if (pstmtDelegate == null) { pstmtDelegate = getOraclePstmtDelegate(serverConfig.getDataSource());
if (pstmtDelegate == null) { pstmtDelegate = getOraclePstmtDelegate(serverConfig.getDataSource());
this.dbSequenceBatchSize = config.getServerConfig().getDatabaseSequenceBatchSize(); this.backgroundExecutor = config.getBackgroundExecutor(); this.dataSource = config.getServerConfig().getDataSource(); this.encryptKeyManager = config.getServerConfig().getEncryptKeyManager(); this.databasePlatform = config.getServerConfig().getDatabasePlatform();
this.dbSequenceBatchSize = config.getServerConfig().getDatabaseSequenceBatchSize(); this.backgroundExecutor = config.getBackgroundExecutor(); this.dataSource = config.getServerConfig().getDataSource(); this.encryptKeyManager = config.getServerConfig().getEncryptKeyManager(); this.databasePlatform = config.getServerConfig().getDatabasePlatform();
this.dbSequenceBatchSize = serverConfig.getDatabaseSequenceBatchSize(); this.backgroundExecutor = config.getBackgroundExecutor(); this.dataSource = serverConfig.getDataSource(); this.encryptKeyManager = serverConfig.getEncryptKeyManager(); this.databasePlatform = serverConfig.getDatabasePlatform();