/** * Drops the current schema, emptying the database */ public void dropSchema() throws IntactTransactionException { SchemaUtils.dropSchema(); }
/** * Drops and creates the schema. Beware that it commits transactions * @param initializeDatabase If false, do not initialize the database (e.g. don't create Institution) */ public static void resetSchema(boolean initializeDatabase) throws IntactTransactionException { if (log.isDebugEnabled()) log.debug("Resetting schema"); dropSchema(); createSchema(initializeDatabase); } }
/** * Drops and creates the schema. Beware that it commits transactions * @param initializeDatabase If false, do not initialize the database (e.g. don't create Institution) */ public static void resetSchema(boolean initializeDatabase) throws IntactTransactionException { if (log.isDebugEnabled()) log.debug("Resetting schema"); dropSchema(); createSchema(initializeDatabase); } }
/** * Drops and creates the schema. Beware that it commits transactions * @param initializeDatabase If false, do not initialize the database (e.g. don't create Institution) */ public static void resetSchema(boolean initializeDatabase) throws IntactTransactionException { if (log.isDebugEnabled()) log.debug("Resetting schema"); DataContext dataContext = IntactContext.getCurrentInstance().getDataContext(); if (dataContext.isTransactionActive()) { throw new IllegalStateException("To reset the schema, the transaction must NOT be active: "+dataContext.getDaoFactory().getCurrentTransaction()); } dropSchema(); createSchema(initializeDatabase); } }