Hi, I'm struggle with dropping and re-creating an Derby in-memory-DB without shutting down the application. The contents of the db is to big to use delete (it took about 30 seconds), so I tried to drop db and re-create it but have problems doing this.
The property below seems only to apply to re-start of the application, not seesionFactory.close(). <property name="hbm2ddl.auto">create-drop</property> (or the other options...)
I tried to use: AnnotationConfiguration annConf = new AnnotationConfiguration().configure(); m_dropScript = annConf.generateDropSchemaScript(Dialect.getDialect()); m_createScript = annConf.generateSchemaCreationScript(Dialect.getDialect());
and send the scripts to the db row by row to first drop then re-create. It worked... it took about 1 second and that is an acceptable time, but the db is only 1/10 as fast after that. Something seems to put sirup into the db by doing that. Bug? How to report?
I've been looking around for 3 days in different forums without getting closer to the solution. Anyone who knows how to do drop and re-create on the fly?
Grateful for help! Olav
|