Cannot close ticket with invocation error

Continuing the discussion from Customer ticket error:

[quote=“Denis, post:1, topic:933, full:true”]
Hi,

My dad uses Sambapos4 and its been working great. he has however encountered an issue that he asked me to assist him with.

There is one customer account ticket that can’t be opened or deleted so i would like to know which rows in which tables to i need to delete in the SQL DB to get rid of this ticket, please see below error and advise.

[General Info]
 
Application: SambaPOS
Version:     4.1.17 BETA
Region:      en
DB:          SQ
Machine:     HEINO-PC
User:        Heino
Date:        4/2/2014
Time:        11:17 AM
 
User Explanation:
 
Heino said ""
-----------------------------
 
[Exception Info 1]
 
Top-level Exception
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()
 
Inner Exception 1
Type:        System.ArgumentException
Message:     An item with the same key has already been added.
Source:      mscorlib
Stack Trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Samba.Presentation.ViewModels.AccountBalances.UpdateBalances()
   at Samba.Modules.PosModule.PosViewModel.set_SelectedTicket(Ticket value)
   at Samba.Modules.PosModule.PosViewModel.OpenTicket(Int32 id)
   at Samba.Modules.PosModule.PosViewModel.OnEntitySelectedForTicket(EventParameters`1 eventParameters)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)
 
-----------------------------
 
[Assembly Info]
 
Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
PresentationCore, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
System, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
DevExpress.Xpf.Grid.v13.2, Version=13.2.7.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
DevExpress.Xpf.Grid.v13.2.Core, Version=13.2.7.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
DevExpress.Xpf.Core.v13.2, Version=13.2.7.0
PropertyTools, Version=2012.4.14.1
 
-----------------------------
 
[System Info]
 
Operating System
-Microsoft Windows 7 Ultimate
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = 120
--FreePhysicalMemory = 1470952
--OSArchitecture = 32-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601
 
Machine
-HEINO-PC
--Manufacturer = Gigabyte Technology Co., Ltd.
--Model = G41M-Combo
--TotalPhysicalMemory = 3452428288
--UserName =
 
-----------------------------

Thanks
Denis

I have the same problem. Does anyone have a solution for this issue. I have tried to create another ticket and was able to close that one, but i cannot open or close the current ticket. I am not able to close the work period. please help.
[/quote]

Can you PM me a zip of your backup?

Thank you very much for the database backup. There is no currently open ticket in database and I can close work period. Can you give more details about the issue?

The reason of the error message is duplicate selection of (Martin…) entity. Normally that shouldn’t be possible. Do you remember something specific about this ticket? Are you using mag card readers?

PS: I’ve fixed ticket display issue and you’ll be able to close it. However before uploading it I want to implement something to prevent this.

OK. Sorry for the monologue :slight_smile: @chinitowings01 kindly explained the reason of the error in detail with e-mail and I’ve solved it. It will work fine after next update (4.1.74). The problem was scanning mag card from multiple terminals while keeping tickets open. Our concurrency check is a lot better now.

Thanks Emre for the prompt response and solving the problem.