locked
System.Exception: 'NHibernate.ObjectNotFoundException: No row with the given identifier exists [SDPJDomain.Domain.Process # 64458] RRS feed

  • Question

  • User662762443 posted

    Friends I'm having a problem generating a report for a query. It turns out that I'm getting the following error message that I do not know because I do not have much experience with nhibernate.

    System.Exception: 'NHibernate.ObjectNotFoundException: No row with the given identifier exists [SDPJDomain.Domain.Process # 64458] 
    
    in NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound (String entityName, Object id) 
    
    in NHibernate.Event.Default.DefaultLoadEventListener.Load (LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options)
     
    in NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad (LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) 
    
    in NHibernate.Event.Default.DefaultLoadEventListener.OnLoad (LoadEvent event, LoadType loadType) 
    
    in NHibernate.Impl.SessionImpl.FireLoad (LoadEvent event, LoadType loadType) 
    
    in NHibernate.Impl.SessionImpl.InternalLoad (String entityName, Object id, Boolean eager, Boolean isNullable) 
    
    in NHibernate.Type.EntityType.ResolveIdentifier (Object id, ISessionImplementor session) 
    
    in NHibernate.Type.EntityType.ResolveIdentifier (Object value, ISessionImplementor session, Object owner) 
    
    in NHibernate.Engine.TwoPhaseLoad.InitializeEntity (Object entity, Boolean readOnly, ISessionImplementor session, PreLoadEvent preLoadEvent, PostLoadEvent postLoadEvent) 
    
    in NHibernate.Loader.Loader.InitializeEntitiesAndCollections (IList hydratedObjects, Object resultSetId, ISessionImplementor session, Boolean readOnly) 
    
    in NHibernate.Loader.Loader.DoQuery (ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) 
    
    in NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections (ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) 
    
    in NHibernate.Loader.Loader.DoList (ISessionImplementor session, QueryParameters queryParameters) 
    
    in NHibernate.Loader.Loader.ListIgnoreQueryCache (ISessionImplementor session, QueryParameters queryParameters) 
    
    in NHibernate.Loader.Loader.List (ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType [] resultTypes) 
    
    in NHibernate.Impl.SessionImpl.List (CriteriaImpl criteria, IList results) 
    
    in NHibernate.Impl.CriteriaImpl.List (IList results) 
    
    in NHibernate.Impl.CriteriaImpl.List [T] () 
    
    in SDPJDomain.DataAccess.InterestDataO.ProperInterPorCpf (String cpf) in D:\SVN\SDP\SDPJ\branches\v6\SDPJDomain\DataAccess\ProcessInterestData.cs: line 269 '
    
    
    in SDPJDominio.DataAccess.InterestDataO.ProperInterPorCpfList (String cpf)
     
    in D:\SVN\SDP\SDPJ\branches\v6\SDPJDomain\DataAccess\ProcessInterestData.cs: line 274
    
    in SDPJDomain.APL.ApplicationInterested.listProcInterPorCpf (String cpf) 
    
    in D:\SVN\Repository\SDP\SDPJ\branches\v6\SDPJDomain\APL\ApplicationProcessInterested.cs: line 69
    
    in SDPJView.Reports.DirfRel.RelDirf.btnGenerate_Click (Object sender, EventArgs e) 
    
    in D:\SVN\SDP\SDPJ\branches\v6\SDPJView\Reports\DirfRel\RelDirf.aspx.cs: line 61
    
    in System.Web.UI.WebControls.Button.OnClick (EventArgs and)
    
    in System.Web.UI.WebControls.Button.RaisePostBackEvent (String eventArgument)at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (String eventArgument)
    
       in System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, String eventArgument)
    
       in System.Web.UI.Page.RaisePostBackEvent (NameValueCollection postData)
    
       at System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Next I have the codes related to each line described in the error:

    public static List <ProcessInterest> ListProcInterPorCpf (string cpf)
    
            {
    
                ISession session = NhibernateHelper.
    
                ProcessInterested ProcInter;
    
     
    
                try
    
                {
    
                    ProcInter = newInterestedProcess ();
    
                    ICriteria criteria = session.CreateCriteria (ProcInter.GetType ());
    
                    Criteria.CreateAlias ​​("Interested", "i"). Add (NHibernate.Criterion.Expression.Like ("i.CPF_CNPJ", cpf));
    
                    var aux = criteria.List <ProcessInterest> (). ToList ();
    
                    return aux;
    
                }
    
                catch (Exception e)
    
                {
    
                    throw new Exception (e.ToString ()); // line 274
    
                }
    
            }



    //269 ​​(Attention-error in this line, bringing as null):                                var aux = criteria.List <ProcessInterest> (). ToList ();
    // Application Process
    
                                  
    
         public List <ProcessInterest> listProcInterPorCpf (string cpf)
    
            {
    
             return ProcessInterestedData.ListProcInterPorCpf (cpf); // line 69
    
            }
    
                                   }

    Is there any condition to handle this or something similar, because I do not know what I do to solve this problem anymore. Could someone better instruct me?

    Thursday, November 22, 2018 2:04 AM

Answers