Error When Starting Work Period

Dear All,

Lately, i got this error whenever i want to start the work period.
It started to appear last month, and it appears everyday. It never happened before.

Hope someone can help me to solve this problem.

[General Info]

Application: SambaPOS
Version:     5.1.54
Region:      en
DB:          SQ
Machine:     BUNANIK
User:        ADMIN
Date:        2/12/2016
Time:        21:34

User Explanation:

ADMIN said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Data.Entity.Core.EntityCommandExecutionException
Message:     An error occurred while executing the command definition. See the inner exception for details.
Source:      EntityFramework
Stack Trace: at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
   at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   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.Persistance.Implementations.InventoryDao.GetTickets(WorkPeriod workPeriod)
   at Samba.Presentation.Services.Implementations.InventoryModule.InventoryService.CalculateCost(PeriodicConsumption pc, WorkPeriod workPeriod)
   at Samba.Presentation.Services.Implementations.InventoryModule.InventoryService.UpdatePeriodicConsumptionCost()
   at Samba.Presentation.Services.Implementations.InventoryModule.InventoryService.DoWorkPeriodStart()
   at Samba.Presentation.Services.Implementations.InventoryModule.InventoryWorkperiodProcessor.ProcessWorkPeriodStart(WorkPeriod workPeriod)
   at Samba.Presentation.Services.Implementations.WorkPeriodModule.WorkperiodClient.StartWorkPeriod(String description)

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.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)

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

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

[Assembly Info]

mscorlib, Version=4.0.0.0
PresentationFramework, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.11.0
System.Core, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Localization, Version=1.0.0.0
FastButton, Version=1.0.0.0

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

[System Info]

Operating System
-Microsoft Windows 7 Professional
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 420
--FreePhysicalMemory = 1708828
--OSArchitecture = 32-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

Machine
-BUNANIK
--Manufacturer = ZOTAC
--Model = ZBOX-ID83
--TotalPhysicalMemory = 3455721472
--UserName = BUNANIK\ADMIN

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

######################### E N D #########################

Its having trouble connecting to your SQL server. So ensure its working, make sure you turn off any sleep options for your computer, also be sure and disable any harddrive hibernation etc.

1 Like

Dear Kendash,

I’ve checked my SQL Server, and it seems fine.
I used samba v5 for couple months without any problem, and just lately this error showed up everyday.

Lately everytime i want to start the work period, this error showed up first.
But if i click ok and click the start work period again. The error didn’t showed up, and the working period started normally.

Or maybe i should clear the database after 1.5 years of sambapos use?

Thanks before @Jesse

It is network related problem not your database.
Obviously, it lost connection when you first click and it take sometime to reconnect that why 2nd time works.

Unless you have problem starting work period on server itself. Next time, try to start work period on server and see if there is any issue.

Dear @sukasem,

I did start the work period on the server.
The strage thing is, after the error showed up… I immediately click okay and start the work period again (not even 5 seconds) and it’s running normal.

I think your server hard drive goes to sleep/standby mode. Did you change Power Option to always on and high performance?

1 Like

The error is specific, it says exactly what happens which is it can’t connect to SQL instance. You need to figure out why. I too think it may be HD hibernation.

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)

As @Jesse mentions, the error is very specific. It cannot connect to SQL Server instance in a timely manner. This is not a SambaPOS issue.

  • Check Windows Services to ensure SQL Server is set to start Automatically.
  • Disable non-essential services.
  • Defragment your HDD to ensure the SambaPOS.mdf file is as contiguous as possible.
  • check power settings to ensure HDD does not spin down or sleep
  • upgrade to a SSD

Application: SambaPOS
Version: 5.1.54
Region: en
DB: SQ

  • Upgrade to latest version, which is 5.1.58 as of this writing.[quote=“kelvin, post:3, topic:9414”]
    maybe i should clear the database after 1.5 years of sambapos use?
    [/quote]

This should not be necessary. I have been using SambaPOS for 4 years with the same DB, which is over 500MB in size, with the largest table containing over 250K records. Currently running SQL Express 2014 x64 on a ZBOX with i3-4x, 8GB RAM, 250GB SSD, and Window 10.

Dear all,

I’ve tried to adjust all the power settings but the error is still popping up.
Let me defrag and update the sambapos first and let you guys know about the result.
If it still popping up i’m considering a hard drive swap to ssd.

Thanks before,

Kelvin

1 Like