Error during end of day

Error during end of day

Environment: 

6.5 update 6


Problem Statement:

An error pops up when trying to perform the end of day activity.



"Load failed. Criteria - NHibernate.Criterion.QueryOver'2[CXS.SubSystem.labor.LaborSession, CXS.SubSystem.Labor.laborSession]"


Log Details:

<Message>query did not return a unique result: 2</Message>
<ExceptionInfo>
<Type>NHibernate.NonUniqueResultException</Type>
<Message>query did not return a unique result: 2</Message>
<Source>NHibernate</Source>
<TargetSite>System.Object UniqueElement(System.Collections.IList)</TargetSite>
<StackTrace> at NHibernate.Impl.AbstractQueryImpl.UniqueElement(IList list)
at NHibernate.Impl.CriteriaImpl.UniqueResult[T]()
at NHibernate.Criterion.QueryOver`1.SingleOrDefault()
at NHibernate.Criterion.QueryOver`1.NHibernate.IQueryOver&lt;TRoot&gt;.SingleOrDefault()
at ‍‍‪‪‫‎‌‍‫‎‎‎‪‪‫‏‫.‪‎‎‪‎‫‎‌‌‏‌‌‎[&#x1;](IQueryOver`1 )</StackTrace>


Proposed Solution/Workaround:

Follow the below steps



Through Profiler find the query related to laborsession -

exec sp_executesql N'SELECT this_.LaborSessionKey as LaborSes1_182_0_, this_.StoreKey as StoreKey182_0_, this_.UserKey as UserKey182_0_,
this_.JobCodeKey as JobCodeKey182_0_, this_.BusinessDate as Business5_182_0_, this_.StartDate as StartDate182_0_,
this_.EndDate as EndDate182_0_, this_.BreakCount as BreakCount182_0_, this_.TotalBreakTime as TotalBre9_182_0_,
this_.TotalTime as TotalTime182_0_, this_.Status as Status182_0_, this_.LastBreakTime as LastBre12_182_0_, this_.CreatedBy as CreatedBy182_0_, this_.Created as Created182_0_,
this_.ModifiedBy as ModifiedBy182_0_, this_.Modified as Modified182_0_ FROM LbrLaborSession this_ WHERE ((this_.StoreKey = @p0 and this_.UserKey = @p1) and not (this_.Status = @p2))',
N'@p0 bigint,@p1 bigint,@p2 int',@p0=10000000000002,@p1=20000000000004,@p2=3

select * from LbrLaborSession where storekey=10000000000002 and UserKey=20000000000004 and status <> 3

select * into LbrLaborSessionTemp from LbrLaborSession where storekey=10000000000002 and UserKey=20000000000004 and status <> 3

begin tran

Delete from LbrLaborSession where storekey=10000000000002 and UserKey=20000000000004 and status <> 3 and LaborSessionKey=20000000000718
rollback tran


Constraints / Scenarios:

Before executing delete query, take backup of records into temp table.



    • Related Articles

    • Unable to perform End Of Day at Store Management Console

      Problem statement Unable to perform End Of day. Environment iVend Retail 6.5 Update 6 Patch 2021_23 Symptoms While performing the End Of Day at store management console system gives the below error. "Cannot save store. Store count exceeds number of ...
    • Unable to Perform End Of Day from Point Of Sale.

      Environment: iVend Retail 365 Problem statement: Configure End OF Day button for POS from the POS Layout in Management Console, however when clicked on End of Day button system gave the below error. “User Does not have update access Object Id- Store" ...
    • Till Mgmt and End of Day Processes in iVend Retail

      Master Till The first step is to create the Master Tills. Each till requires a unique master record to be defined and then from this the user can set up the reusable tills. Each master till is used to generate the tills for use at the POS each ...
    • Disable automatic End Of Day report generation when doing End of Day process at Day End

      Requirement Customer wants to disable automatic End Of Day report at Day End means when the user doing the "End of day" process at the store" then no report should generate at the store Version 6.5 Update 6. Answer There is no such feature available ...
    • Not able to do End Of Day and showing error message 'Till Session not available'

      Environment : iVend 6.5 Update 5 with SAPB1 Problem Statement : Customer has informed that unable to do EOD while selecting the assigned till showing error message ‘Till Session is not available’. Symptoms : Some tills were in assigned status and not ...