Author Topic: Workperiod Report Error  (Read 23276 times)

evail

  • Full Member
  • ***
  • Posts: 109
Workperiod Report Error
« on: April 26, 2013, 11:26:25 pm »
[Exception Info 1]

Top-level Exception
Type:        System.Data.EntityCommandExecutionException
Message:     An error occurred while executing the command definition. See the inner exception for details.
Source:      System.Data.Entity
Stack Trace: at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Samba.Persistance.Data.Dao.Query[T](Expression`1 predictate, Expression`1[] includes)
   at Samba.Modules.BasicReports.ReportContext.GetTickets(IWorkspace workspace)
   at Samba.Modules.BasicReports.ReportContext.get_Tickets()
   at Samba.Modules.BasicReports.Reports.EndOfDayReport.EndDayReportViewModel.GetReport()
   at Samba.Modules.BasicReports.ReportViewModelBase.<>c__DisplayClass9.<RefreshReport>b__2(Object , DoWorkEventArgs )
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Inner Exception 1
Type:        System.Data.SqlClient.SqlException
Message:     Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Source:      .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)

Inner Exception 2
Type:        System.ComponentModel.Win32Exception
Message:     The wait operation timed out
Source:

-----------------------------

[Assembly Info]

System.Windows.Interactivity, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
mscorlib, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationCore, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
System.Windows.Forms, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Microsoft.Practices.EnterpriseLibrary.Validation, Version=5.0.414.0
System.Management, Version=4.0.0.0
UIControls, Version=1.0.0.0
PropertyTools.Wpf, Version=2011.3.4703.24609
Samba.Domain, Version=1.0.0.0
System.Drawing, Version=4.0.0.0
System.Core, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
mscorlib, Version=2.0.0.0
WindowsFormsIntegration, Version=4.0.0.0
FlexButton, Version=1.0.0.0
Samba.Persistance.Data, Version=1.0.0.0
Samba.Services, Version=1.0.0.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 7 Home Premium
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 300
--FreePhysicalMemory = 1471712
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601



This error is coming up whenever i select a particular date in workperiod. Thats is 18th April to any other date.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Workperiod Report Error
« Reply #1 on: May 02, 2013, 12:42:42 am »
Hello evail. This is a timeout error. Does it happen everytime you enter workperiod reports? Can you create a month range report?

evail

  • Full Member
  • ***
  • Posts: 109
Re: Workperiod Report Error
« Reply #2 on: May 02, 2013, 03:25:58 am »
Emre,

thanks for the post. it does not happen often, yes i can take monthly reports.

there were 2 cases where work period was ended twice, in order to make further transactions. in those 2 cases I am not able to take a work period report at all if that date is within the range.

isit possible to have a timeout if there are too many tickets within the workperiod?


emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Workperiod Report Error
« Reply #3 on: May 02, 2013, 03:30:48 am »
If you upgraded from sdf there is a chance required indexes not created.

Can you check if IDX_TicketItems_All index exists in your database?

evail

  • Full Member
  • ***
  • Posts: 109
Re: Workperiod Report Error
« Reply #4 on: May 02, 2013, 04:37:10 am »
I am not able to find the indexes from the database. maybe am not understanding.
i have opened the database using management studio.

which table should i be looking for?

when i was going through the ticket lists from the database there was 1 ticket with missing [PrintJobData]. all others contains "3:1"
will this pose a problem?

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Workperiod Report Error
« Reply #5 on: May 02, 2013, 05:14:19 am »
You'll expand Tables > dbo.TicketItems > Indexes node to display existing indexes for TicketItems table..

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Workperiod Report Error
« Reply #6 on: May 02, 2013, 06:31:16 am »
... and nothing to worry about printjobdata. It holds how many times a print job executed.

evail

  • Full Member
  • ***
  • Posts: 109
Re: Workperiod Report Error
« Reply #7 on: May 02, 2013, 12:40:54 pm »
only "PK__TicketItems__0000000000000146" is there within the indexes.


emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Workperiod Report Error
« Reply #8 on: May 03, 2013, 01:32:02 am »
CREATE NONCLUSTERED INDEX IDX_TicketItems_All ON TicketItems (TicketId) INCLUDE (Id,MenuItemId,MenuItemName,PortionName,Price,CurrencyCode,Quantity,PortionCount,Locked,Voided,ReasonId,Gifted,OrderNumber,CreatingUserId,CreatedDateTime,ModifiedUserId,ModifiedDateTime,PriceTag,Tag,DepartmentId,VatRate,VatAmount,VatTemplateId,VatIncluded)

CREATE NONCLUSTERED INDEX IDX_TicketItemProperties_All ON TicketItemProperties (TicketItemId) INCLUDE (Id,Name,PropertyPrice_CurrencyCode,PropertyPrice_Amount,PropertyGroupId,Quantity,MenuItemId,PortionName,CalculateWithParentPrice,VatAmount)

CREATE NONCLUSTERED INDEX IDX_Payments_All ON Payments (Ticket_Id) INCLUDE (Id,Amount,Date,PaymentType,UserId,DepartmentId)

You can use these three sql scripts to create missing indexes.

Normally we create them automatically but since SQL Compact does not support nonclustered indexes people who switches from SDF to SQL should check if they exists or not.


AS ALWAYS DON'T FORGET BACKUPS :)
« Last Edit: May 03, 2013, 01:33:41 am by emre »

evail

  • Full Member
  • ***
  • Posts: 109
Re: Workperiod Report Error
« Reply #9 on: May 03, 2013, 06:12:32 am »
Works Great!
Thanks Emre,
Keep up the good work.

As for backups i use this little software called SQLBackupAndFTP.
it takes automatic backup everyday.

Thanks again