The inner exception is "Specified cast is not valid.", but this doesn't tell me much.
The contents of the call stack is:
Code:
- ex {"Could not save object" } System.Exception
+ [NHibernate.ADOException] {NHibernate.ADOException} NHibernate.ADOException
System.Object {NHibernate.ADOException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2146232832 int
- _innerException {"Specified cast is not valid." } System.Exception
+ [System.InvalidCastException] {"Specified cast is not valid." } System.InvalidCastException
System.Object {System.InvalidCastException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2147467262 int
_innerException { } System.Exception
_message "Specified cast is not valid." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
+ _stackTrace {System.Array} System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2147467262 int
InnerException { } System.Exception
Message "Specified cast is not valid." string
Source "NHibernate" string
StackTrace " at NHibernate.Type.SetType.Wrap(ISessionImplementor session, Object collection)\r\n at NHibernate.Impl.WrapVisitor.ProcessArrayOrNewCollection(Object collection, PersistentCollectionType collectionType)\r\n at NHibernate.Impl.WrapVisitor.ProcessCollection(Object collection, PersistentCollectionType collectionType)\r\n at NHibernate.Impl.AbstractVisitor.ProcessValue(Object value, IType type)\r\n at NHibernate.Impl.WrapVisitor.ProcessValues(Object[] values, IType[] types)\r\n at NHibernate.Impl.SessionImpl.DoSave(Object obj, Key key, IClassPersister persister, Boolean replicate, Boolean useIdentityColumn, CascadingAction cascadeAction, Object anything)\r\n at NHibernate.Impl.SessionImpl.DoSave(Object obj, Object id, IClassPersister persister, Boolean useIdentityColumn, CascadingAction cascadeAction, Object anything)\r\n at NHibernate.Impl.SessionImpl.SaveWithGeneratedIdentifier(Object obj, CascadingAction action, Object anything)" string
+ TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase
_message "Could not save object" string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
+ _stackTrace {System.Array} System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2146232832 int
+ InnerException {"Specified cast is not valid." } System.Exception
Message "Could not save object" string
Source "NHibernate" string
StackTrace " at NHibernate.Impl.SessionImpl.SaveWithGeneratedIdentifier(Object obj, CascadingAction action, Object anything)\r\n at NHibernate.Impl.SessionImpl.Save(Object obj)\r\n at LeagueManager.Core.Service.CoreRepository.SaveObject(Object obj) in e:\\dotnet\\league manager\\core\\leaguemanager.core\\service\\corerepository.cs:line 151" string
+ TargetSite {System.Reflection.RuntimeMethodInfo} System.Reflection.MethodBase
Is the id of the object well defined in my hbm.xml?
Code:
<id name="Id" type="Int32" column="customerid" unsaved-value="-1">
<generator class="identity"/>
</id>