public Void execute(CommandContext commandContext) { String databaseSchemaUpdate = Context.getProcessEngineConfiguration().getDatabaseSchemaUpdate(); PersistenceSession persistenceSession = commandContext.getSession(PersistenceSession.class); if (ProcessEngineConfigurationImpl.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) { try { persistenceSession.dbSchemaDrop(); } catch (RuntimeException e) { // ignore } } if ( ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate) || ProcessEngineConfigurationImpl.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate) || ProcessEngineConfigurationImpl.DB_SCHEMA_UPDATE_CREATE.equals(databaseSchemaUpdate) ) { persistenceSession.dbSchemaCreate(); } else if (ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) { persistenceSession.dbSchemaCheckVersion(); } else if (ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) { persistenceSession.dbSchemaUpdate(); } return null; } }
public DbEntityManager(IdGenerator idGenerator, PersistenceSession persistenceSession) { this.idGenerator = idGenerator; this.persistenceSession = persistenceSession; if (persistenceSession != null) { this.persistenceSession.addEntityLoadListener(this); } initializeEntityCache(); initializeOperationManager(); }
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaPrune(); return null; } });
protected void flushDbOperationManager() { // obtain totally ordered operation list from operation manager List<DbOperation> operationsToFlush = dbOperationManager.calculateFlush(); if (operationsToFlush == null || operationsToFlush.size() == 0) { return; } LOG.databaseFlushSummary(operationsToFlush); // If we want to delete all table data as bulk operation, on tables which have self references, // We need to turn the foreign key check off on MySQL and MariaDB. // On other databases we have to do nothing, the mapped statement will be empty. if (isIgnoreForeignKeysForNextFlush) { persistenceSession.executeNonEmptyUpdateStmt(TOGGLE_FOREIGN_KEY_STMT, false); persistenceSession.flushOperations(); } try { final List<List<DbOperation>> batches = CollectionUtil.partition(operationsToFlush, BATCH_SIZE); for (List<DbOperation> batch : batches) { flushDbOperations(batch); } } finally { if (isIgnoreForeignKeysForNextFlush) { persistenceSession.executeNonEmptyUpdateStmt(TOGGLE_FOREIGN_KEY_STMT, true); persistenceSession.flushOperations(); isIgnoreForeignKeysForNextFlush = false; } } }
public Object execute(CommandContext commandContext) { PersistenceSession persistenceSession = commandContext.getSession(PersistenceSession.class); persistenceSession.dbSchemaDrop(); persistenceSession.dbSchemaCreate(); HistoryLevelSetupCommand.dbCreateHistoryLevel(commandContext); return null; } });
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaDrop(); return null; } });
boolean doOptimisticLockingException = false; try { persistenceSession.executeDbOperation(dbOperation); } catch (Exception e) { List<BatchResult> flushResult = new ArrayList<BatchResult>(); try { flushResult = persistenceSession.flushOperations(); } catch (Exception e) {
public Object execute(CommandContext commandContext) { commandContext.getSession(PersistenceSession.class).dbSchemaCreate(); return null; } });
public void commit() { LOG.debugTransactionOperation("firing event committing..."); fireTransactionEvent(TransactionState.COMMITTING); LOG.debugTransactionOperation("committing the persistence session..."); getPersistenceProvider().commit(); LOG.debugTransactionOperation("firing event committed..."); fireTransactionEvent(TransactionState.COMMITTED); }
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaDrop(); return null; } });
protected void flushDbOperationManager() { // obtain totally ordered operation list from operation manager List<DbOperation> operationsToFlush = dbOperationManager.calculateFlush(); if (operationsToFlush == null || operationsToFlush.size() == 0) { return; } LOG.databaseFlushSummary(operationsToFlush); // If we want to delete all table data as bulk operation, on tables which have self references, // We need to turn the foreign key check off on MySQL and MariaDB. // On other databases we have to do nothing, the mapped statement will be empty. if (isIgnoreForeignKeysForNextFlush) { persistenceSession.executeNonEmptyUpdateStmt(TOGGLE_FOREIGN_KEY_STMT, false); persistenceSession.flushOperations(); } try { final List<List<DbOperation>> batches = CollectionUtil.partition(operationsToFlush, BATCH_SIZE); for (List<DbOperation> batch : batches) { flushDbOperations(batch); } } finally { if (isIgnoreForeignKeysForNextFlush) { persistenceSession.executeNonEmptyUpdateStmt(TOGGLE_FOREIGN_KEY_STMT, true); persistenceSession.flushOperations(); isIgnoreForeignKeysForNextFlush = false; } } }
boolean doOptimisticLockingException = false; try { persistenceSession.executeDbOperation(dbOperation); } catch (Exception e) { List<BatchResult> flushResult = new ArrayList<BatchResult>(); try { flushResult = persistenceSession.flushOperations(); } catch (Exception e) {
public Object execute(CommandContext commandContext) { commandContext.getSession(PersistenceSession.class).dbSchemaCreate(); return null; } });
public void commit() { LOG.debugTransactionOperation("firing event committing..."); fireTransactionEvent(TransactionState.COMMITTING); LOG.debugTransactionOperation("committing the persistence session..."); getPersistenceProvider().commit(); LOG.debugTransactionOperation("firing event committed..."); fireTransactionEvent(TransactionState.COMMITTED); }
public Void execute(CommandContext commandContext) { String databaseSchemaUpdate = Context.getProcessEngineConfiguration().getDatabaseSchemaUpdate(); PersistenceSession persistenceSession = commandContext.getSession(PersistenceSession.class); if (ProcessEngineConfigurationImpl.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) { try { persistenceSession.dbSchemaDrop(); } catch (RuntimeException e) { // ignore } } if ( ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate) || ProcessEngineConfigurationImpl.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate) || ProcessEngineConfigurationImpl.DB_SCHEMA_UPDATE_CREATE.equals(databaseSchemaUpdate) ) { persistenceSession.dbSchemaCreate(); } else if (ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) { persistenceSession.dbSchemaCheckVersion(); } else if (ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) { persistenceSession.dbSchemaUpdate(); } return null; } }
public Object execute(CommandContext commandContext) { String databaseSchemaUpdate = Context.getProcessEngineConfiguration().getDatabaseSchemaUpdate(); if (ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate)) { commandContext.getSession(PersistenceSession.class).dbSchemaDrop(); } return null; } }
protected void flushDbOperationManager() { // obtain totally ordered operation list from operation manager List<DbOperation> operationsToFlush = dbOperationManager.calculateFlush(); if (operationsToFlush == null || operationsToFlush.size() == 0) { return; } LOG.databaseFlushSummary(operationsToFlush); // If we want to delete all table data as bulk operation, on tables which have self references, // We need to turn the foreign key check off on MySQL and MariaDB. // On other databases we have to do nothing, the mapped statement will be empty. if (isIgnoreForeignKeysForNextFlush) { persistenceSession.executeNonEmptyUpdateStmt(TOGGLE_FOREIGN_KEY_STMT, false); persistenceSession.flushOperations(); } try { final List<List<DbOperation>> batches = CollectionUtil.partition(operationsToFlush, BATCH_SIZE); for (List<DbOperation> batch : batches) { flushDbOperations(batch); } } finally { if (isIgnoreForeignKeysForNextFlush) { persistenceSession.executeNonEmptyUpdateStmt(TOGGLE_FOREIGN_KEY_STMT, true); persistenceSession.flushOperations(); isIgnoreForeignKeysForNextFlush = false; } } }
boolean doOptimisticLockingException = false; try { persistenceSession.executeDbOperation(dbOperation); } catch (Exception e) { List<BatchResult> flushResult = new ArrayList<BatchResult>(); try { flushResult = persistenceSession.flushOperations(); } catch (Exception e) {
public Object execute(CommandContext commandContext) { commandContext.getSession(PersistenceSession.class).dbSchemaCreate(); return null; } });
public Object execute(CommandContext commandContext) { commandContext .getSession(PersistenceSession.class) .dbSchemaPrune(); return null; } });