-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Drop and re-create in-memory db
PostPosted: Wed Dec 23, 2009 10:43 am 
Newbie

Joined: Wed Dec 23, 2009 10:24 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.