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: SchemaUpdate with multiple databases
PostPosted: Fri Sep 19, 2008 5:00 am 
Newbie

Joined: Mon Aug 11, 2008 5:45 am
Posts: 15
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.0

I am accessing multiple databases via nhibernate using single SessionFactory. I followed this post to do that :-http://forum.hibernate.org/viewtopic.php?t=962161

I can access multiple databases successfully but when I try to use schemaUpdate of hbm2ddl utility, Nhibernate generates CreateTable statement instead of alter table for the second database.

For Example:-

DB1 Tables: Products and Category

DB2 Table: Message

In Connectionstring I have specified that Nhibernate is connected to DB1

ConnectionString="Server=localhost\SQLExpress;initial catalog=nhibernate;database=DB1; Integrated security=SSPI"

When I change something in the mapping of Product or Category and call SchemaUpdate.Execute(), NHibernate generates alter table statement. But when I change something in Message mapping and call SchemaUpdate.Execute() it generates a create table statement.

Can anyone help me in this regard.

Thanks
Syed


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.