Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-2779

Session.Get() can throw InvalidCastException when log-level is set to DEBUG

    Details

    • Sprint:

      Description

      this problem occurs when

      • log-level ist set to DEBUG
      • mapping is master-detail with property-ref and different data type for id and reference property

      stacktrace:
      ADOExceptionReporter:0 - System.InvalidCastException: Das Objekt des Typs "System.Int32" kann nicht in Typ "System.String" umgewandelt werden.
      bei NHibernate.Type.AbstractStringType.ToString(Object val) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Type\AbstractStringType.cs:Zeile 32.
      bei NHibernate.Type.NullableType.ToLoggableString(Object value, ISessionFactoryImplementor factory) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Type\NullableType.cs:Zeile 109.
      bei NHibernate.Impl.MessageHelper.InfoString(ICollectionPersister persister, Object id, ISessionFactoryImplementor factory) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Impl\MessageHelper.cs:Zeile 296.
      bei NHibernate.Engine.Loading.LoadContexts.LocateLoadingCollection(ICollectionPersister persister, Object ownerKey) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Engine\Loading\LoadContexts.cs:Zeile 170.
      bei NHibernate.Type.CollectionType.GetCollection(Object key, ISessionImplementor session, Object owner) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Type\CollectionType.cs:Zeile 247.
      bei NHibernate.Type.CollectionType.ResolveKey(Object key, ISessionImplementor session, Object owner) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Type\CollectionType.cs:Zeile 232.
      bei NHibernate.Type.CollectionType.ResolveIdentifier(Object key, ISessionImplementor session, Object owner) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Type\CollectionType.cs:Zeile 227.
      bei NHibernate.Engine.TwoPhaseLoad.InitializeEntity(Object entity, Boolean readOnly, ISessionImplementor session, PreLoadEvent preLoadEvent, PostLoadEvent postLoadEvent) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Engine\TwoPhaseLoad.cs:Zeile 79.
      bei NHibernate.Loader.Loader.InitializeEntitiesAndCollections(IList hydratedObjects, Object resultSetId, ISessionImplementor session, Boolean readOnly) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Loader\Loader.cs:Zeile 600.
      bei NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Loader\Loader.cs:Zeile 475.
      bei NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Loader\Loader.cs:Zeile 246.
      bei NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) in D:\Projekte\Recherche\NHibernate\NHibernate_trunk\nhibernate\src\NHibernate\Loader\Loader.cs:Zeile 1589.

      unit-test is attached

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                hazzik Alexander Zaytsev
                Reporter:
                anros Andreas Rosenbaum
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Who's Looking?