Help! - Error occurred while executing the command definition

Hey Guys!

Today our restaurant had an error with SambaPOS that I have never seen before. We have ground to a halt and doing everything with paper and carbon copies, so I am hoping to get this resolved asap.

Apparently the computer was running quite slowly today and they turned off the computer and restarted it. Upon computer restart, they started to load SambaPOS4, and after a lengthy delay they got an error popup window: “An error occurred while executing the command definition. See the inner exception for details.”

Before they powered off the computer Samba seemed to be running albeit incredibly slowly which is why they decided to reboot. This is a small country without any knowledge of computers, and I am not sure how they shut things down.

Do you think this is a problem with my database, or a general Windows problem. My POS computer is not hooked up to the internet and looking for some insights how to fix this please!

Here are the report details…

[General Info]

Application: SambaPOS
Version:     4.1.82
Region:      en
DB:          SQ
Machine:     UTOPIA-LENOVO
User:        UtopiaStaff
Date:        6/11/2018
Time:        4:33 AM

User Explanation:

UtopiaStaff said ""

[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.Infrastructure.Data.SqlData.ReadOnlyEFWorkspace.Last[T](Int32 recordCount)
   at Samba.Persistance.Data.Dao.Last[T](Int32 recordCount)
   at Samba.Presentation.Common.Services.ApplicationState.get_LastTwoWorkPeriods()
   at Samba.Presentation.Common.Services.ApplicationState.get_IsCurrentWorkPeriodOpen()
   at Samba.Presentation.Common.Services.ApplicationState.InitializeSettings()
   at Samba.Presentation.Bootstrapper.InitializeShell()
   at Microsoft.Practices.Prism.MefExtensions.MefBootstrapper.Run(Boolean runWithDefaultConfiguration)
   at Samba.Presentation.App.RunInReleaseMode()

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.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.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
   at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
   at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
   at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
   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, SqlDataReader ds)
   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


[Assembly Info]

Samba.Services, Version=
mscorlib, Version=
System, Version=
Microsoft.Practices.Prism, Version=
WindowsBase, Version=
Samba.Infrastructure, Version=
Samba.Infrastructure.Data, Version=
PresentationFramework, Version=
System.Xaml, Version=
Samba.Presentation.Services, Version=
FluentValidation, Version=
Samba.Domain, Version=
DevExpress.Xpf.Grid.v14.1, Version=
DevExpress.Xpf.Grid.v14.1.Core, Version=
PresentationCore, Version=
Stateless, Version=
System.Core, Version=
System.Drawing, Version=
DevExpress.Xpf.Core.v14.1, Version=
EntityFramework, Version=
System.Windows.Forms, Version=
System.ComponentModel.Composition, Version=
Samba.Localization, Version=
Microsoft.CSharp, Version=
Microsoft.Practices.ServiceLocation, Version=
Samba.Persistance, Version=
Microsoft.Practices.Prism.MefExtensions, Version=
PropertyTools, Version=2012.4.14.1


[System Info]

Operating System
-Microsoft Windows 8.1 Single Language
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = 420
--FreePhysicalMemory = 2536716
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

--Manufacturer = LENOVO
--Model = 80N5
--TotalPhysicalMemory = 4202606592
--UserName = Utopia-Lenovo\UtopiaStaff


That error means it could not connect to the database. Could be a bunch of things but check the SQL server service make sure your instance is running. Could try defragging the HD too

Thanks for your advice! I was able to replace the database file with an older version so it seems that the database file was corrupted. I now have to rebuild the menu changes, but at least it works. I will have to take a look at the corrupted database file to see I can retrieve the data, but that seems unlikely since Windoze will not even allow the file to be copied.

(btw… hard drive was 0% fragged)

Hi Ken… Sorry to bother you again.

I have re-setup my menu items from a slightly older database file. The installation is working on my test and setup computer, but it is not working on my main computer when I move the database over.

When I start SambaPOS I get a message “Information. There is a problem. Message: An exception occurred while initializing the database. See the InnerException for details.”.

I remember this being a total pain in the @$$ when this happened to an older installation. I believe my only recourse was to uninstall SambaPOS and SQL and reinstall everything all over again. Is this the solution, or is there another way?

Can you please provide the latest log for that recent error you are experiencing?

Like kendash said, it could be a bunch of things related to SQL, and the SQL service.

It probably is not sambapos related it looks like it is sql server related.