-->
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.  [ 2 posts ] 
Author Message
 Post subject: Location of embedded database
PostPosted: Tue Dec 23, 2008 11:42 am 
Beginner
Beginner

Joined: Fri Jul 06, 2007 9:27 pm
Posts: 22
I am developing an app with NHibernate, using an embedded database (SQL CE). To keep it simple, let's say I have two projects in a VS 2008 solution; the application (a WinForms app) and my unit test app. And let's say my domain classes are in the WinForms app. (No, I'm not actually doing this. But I want to keep the question as simple as I can!)

Right now, the database file is in my test project, since that is what is 'driving' the application. I've been told that NHibernate requires it to be in the driver app.

That means that I am going to need to copy the database over to the WinForms app for production, and I am uncomfortable doing that, since it forks the database used for testing and production. I see a real risk of the two copies getting out of sync.

So, here's my question: Can I configure NHibernate so that the embedded database used for testing can be located in the WinForms app, instead of the unit test app? That way, I can avoid working with two copies of the database.

Thanks for your help!

David Veeneman
Foresight Systems


Top
 Profile  
 
 Post subject: Location of embedded database
PostPosted: Tue Dec 23, 2008 11:56 am 
Beginner
Beginner

Joined: Fri Jul 06, 2007 9:27 pm
Posts: 22
Answered my own question. Turns out that it's quite easy--the database location is determined by the connection string in the cfg.xml file. So, to use the 'app' database for testing, set the connection string in the test app cfg.xml file to point to the database in the production app.


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

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.