-->
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.  [ 3 posts ] 
Author Message
 Post subject: INSERT_IDENTITY OFF?
PostPosted: Thu Aug 09, 2007 11:04 am 
Newbie

Joined: Wed Aug 08, 2007 9:49 am
Posts: 2
Hi

Using MSSQL and nhibernate 2.2

I'm trying to persist a transient instance using the Save() method.

I get the following DAOException:

Cannot insert explicit value for identity column in table 'DriverCategory' when IDENTITY_INSERT is set to OFF.

I am using the "native" generator module in the mapping for the object I'm trying to persist.

Is there a setting I should change on the SQL server?

Can someone shed some light?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 11:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
It is likely a mapping error. Use the SQL Profiler to see what is actually sent to SQL Server. Please post mapping file(s) if you need further assistance.

_________________
Karl Chu


Top
 Profile  
 
 Post subject: Confirmation mapping error
PostPosted: Fri Aug 10, 2007 4:34 am 
Newbie

Joined: Wed Aug 08, 2007 9:49 am
Posts: 2
Karlchu, you were right.
It was due to a mapping error in a recursive association.

Thank you for pointing that possibilty out. I found it a rather awkward error message.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.