-->
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: SchemaExport failing - specifying HBM dependencies?
PostPosted: Tue Feb 05, 2008 3:23 pm 
Newbie

Joined: Sun Jan 20, 2008 3:59 pm
Posts: 3
Location: Washington, DC
I'm trying to run SchemaExport to generate my DB schema, and I have separate HBM mapping files for my classes: Event, EventInvitation, Note, Person. It seems to be failing because of dependencies between these domain classes. Is there a way to specify the order in which these mapping files should be processed?

The specific error message I'm getting is this:
Assembly Initialization method MyAppSample.Tests.NHibernateTestBase.Setup threw exception. NHibernate.HibernateException: NHibernate.HibernateException: There is already an object named 'Person' in the database. ---> System.Data.SqlClient.SqlException: There is already an object named 'Person' in the database.. Aborting test execution.

Stack Trace:
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script, Boolean export, Boolean format, Boolean throwOnError, TextWriter exportOutput, IDbCommand statement, String sql)
NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script, Boolean export, Boolean justDrop, Boolean format, IDbConnection connection, TextWriter exportOutput)
NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script, Boolean export, Boolean justDrop, Boolean format)
NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script, Boolean export, Boolean justDrop, Boolean format)
MyAppSample.Tests.Setup.InfrastructureSetup.BuildDatabase(DataStore datastore) in C:\TeamProjects\MyCompany.MyApp\Sandbox\MyAppSample\MyAppSample.Tests\Setup\InfrastructureSetup.cs: line 38
MyAppSample.Tests.Setup.InfrastructureSetup.SetupNHibernate() in C:\TeamProjects\MyCompany.MyApp\Sandbox\MyAppSample\MyAppSample.Tests\Setup\InfrastructureSetup.cs: line 27
MyAppSample.Tests.NHibernateTestBase.Setup(TestContext context) in C:\TeamProjects\MyCompany.MyApp\Sandbox\MyAppSample\MyAppSample.Tests\NHibernateTestBase.cs: line 25


Top
 Profile  
 
 Post subject: Looks like this was my fault!
PostPosted: Tue Feb 05, 2008 4:21 pm 
Newbie

Joined: Sun Jan 20, 2008 3:59 pm
Posts: 3
Location: Washington, DC
Sorry for the false alarm, it looks like I just had some issues with my DB not being fully dropped before being rebuilt.


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.