Hi all
I just started with .net
Everything is so easy with java-hibernate.
I have everything setup in VS .net 2003 . I have a valid Hibernate Session.
When I try to save using Session.Save(object), no exception is thrown. When I execute transaction.commit, exception is thrown.
I have the same User object supplied in the samples with all properties defined.
Confirmed again, there is no data in the table. So its empty. This is the first insert. And error looks like a duplicate key.? Please help
Database: MS SQL Server 2000
.Net Framework: 1.1 on Windows XP Prof
Here is the exception:
{"could not synchronize database state with session" }
[NHibernate.ADOException]: {NHibernate.ADOException}
System.Object: {NHibernate.ADOException}
_className: null
_COMPlusExceptionCode: -532459699
_exceptionMethod: <undefined value>
_exceptionMethodString: null
_helpURL: null
_HResult: -2146232832
_innerException: {"Violation of PRIMARY KEY constraint 'PK__users__276EDEB3'. Cannot insert duplicate key in object 'users'.\r\nThe statement has been terminated." }
_message: "could not synchronize database state with session"
_remoteStackIndex: 0
_remoteStackTraceString: null
_source: null
_stackTrace: {System.Array}
_stackTraceString: null
_xcode: -532459699
_xptrs: 0
HelpLink: null
HResult: -2146232832
InnerException: {"Violation of PRIMARY KEY constraint 'PK__users__276EDEB3'. Cannot insert duplicate key in object 'users'.\r\nThe statement has been terminated." }
Message: "could not synchronize database state with session"
Source: "NHibernate"
StackTrace: " at NHibernate.Impl.SessionImpl.Execute()\r\n at NHibernate.Impl.SessionImpl.Flush()\r\n at NHibernate.Transaction.AdoTransaction.Commit()\r\n at nukaladotnet._default.Button1_Click(Object sender, EventArgs e) in c:\\inetpub\\wwwroot\\dotnettest\\default.aspx.cs:line 105"
TargetSite: {System.Reflection.RuntimeMethodInfo}
|