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: Could not generate idbag row id
PostPosted: Sun Sep 09, 2007 2:41 am 
Newbie

Joined: Mon Mar 12, 2007 5:34 am
Posts: 7
Hi,

We are using a idbag. Database retrieval works fine. But saving the idbag generates errors. I included all information neccesary. Can anyone help me to solve this problem?

Hibernate version: 1.2.0

Mapping documents:
Code:
<idbag name="CPUntyped" table="Cursist_CP" lazy="true">
   <collection-id column="CollectionId" type="Int32">
      <generator class="hilo"/>
   </collection-id>
   <key column="CursistId"/>
   <many-to-many class="Siea.Cvs.Business.CPCursist, Siea.Cvs.Business" column="CPAfgerondId" fetch="join"/>
</idbag>


Database table code:
Code:
CREATE TABLE [siea_nl].[Cursist_CP](
   [CollectionId] [bigint] IDENTITY(1,1) NOT NULL,
   [CPAfgerondId] [int] NOT NULL,
   [CursistId] [int] NOT NULL,
CONSTRAINT [PK_Cursist_CP_1] PRIMARY KEY CLUSTERED
(
   [CollectionId] ASC
)


Full stack trace of any exception that occurs:
Code:
ERROR [TestRunnerThread] (:0) - could not read a hi value
System.Data.SqlClient.SqlException: Invalid object name 'siea_nl.hibernate_unique_key'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
   at NHibernate.Id.TableGenerator.Generate(ISessionImplementor session, Object obj)
ERROR [TestRunnerThread] (:0) - could not synchronize database state with session
NHibernate.ADOException: Could not generate idbag row id. ---> System.Data.SqlClient.SqlException: Invalid object name 'siea_nl.hibernate_unique_key'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
   at NHibernate.Id.TableGenerator.Generate(ISessionImplementor session, Object obj)
   at NHibernate.Id.TableHiLoGenerator.Generate(ISessionImplementor session, Object obj)
   at NHibernate.Collection.PersistentIdentifierBag.PreInsert(ICollectionPersister persister)
   --- End of inner exception stack trace ---


Name and version of the database you are using: Microsoft SQL Server 2005


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.