PrintJobHandler with Possible Threading Issue

Discussions related to custom development with Select.
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: PrintJobHandler with Possible Threading Issue

Post by John Morris »

Yes, it is.

We will need more details to diagnose further. Can you provide error and call stack details? Also, a standalone repro, if possible, would greatly reduce the time to resolution.
John Morris
Sr. Software Architect
SoftPro
JDavis
Posts: 97
Joined: Mon Sep 22, 2008 5:10 pm

Re: PrintJobHandler with Possible Threading Issue

Post by JDavis »

Stack Traces and exceptions logged on on page 1 of this thread. Most are of this ilk:

<stackTrace> at System.Windows.Forms.BindingSource.get_Count()
at System.Windows.Forms.CurrencyManager.get_Count()
at System.Windows.Forms.BindingSource.ParentCurrencyManager_CurrentItemChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.CurrencyManager.OnCurrentItemChanged(EventArgs e)
at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
at System.Windows.Forms.BindingSource.InnerList_ListChanged(Object sender, ListChangedEventArgs e)
at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
at System.Windows.Forms.BindingSource.InnerList_ListChanged(Object sender, ListChangedEventArgs e)
at SoftPro.EntityModel.ListChangedEventInstance.Fire()
at SoftPro.EntityModel.EntityTransactionContext.<>c__DisplayClass1.<FireEvents>b__0()
at SoftPro.EntityModel.EntitySynchronizationContext.Invoke(Action action)
at SoftPro.EntityModel.EntityTransactionContext.FireEvents()
at SoftPro.EntityModel.EntityTransactionContext.Scope.Dispose()
at SoftPro.EntityModel.EntityExecutionContext.Dispose(Boolean completed)
at SoftPro.EntityModel.EntityExecutionContext.Scope.Dispose()
at SoftPro.EntityModel.Field`1.set_Value(T value)
at RequestedTask.set_Description(String )
at CallSite.Target(Closure , CallSite , Object , String )
at TG.SoftPro.Select.Task.RequestedTask.CreateRequestedTaskForPrintJobTask(IOrder order, PrintJobTask task)</stackTrace>
<Message>BindingSource cannot be its own data source. Do not set the DataSource and DataMember properties to values that refer back to BindingSource.</Message>
<Source>System.Windows.Forms</Source>
<TargetSite>Int32 get_Count()</TargetSite>
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: PrintJobHandler with Possible Threading Issue

Post by John Morris »

That doesn't look like the full call stack. Can you verify?

Also, does this repro with a stand alone sample that you can send us?
John Morris
Sr. Software Architect
SoftPro
JDavis
Posts: 97
Joined: Mon Sep 22, 2008 5:10 pm

Re: PrintJobHandler with Possible Threading Issue

Post by JDavis »

Any sample app would simply be a PrintJobHandler class that implements OnProcess method, gets the IOrder off of the IPrintJob properties and calls a method to add a new RequestedTask to the order and assign a note to the newly created RequestedTask. What exactly do you need for a "stand alone sample"?

I'll modify handler to log full stack trace and get back to you.

This print handler was implemented in 2.6 and worked fine for years until we updated to 4.0 last year.
JDavis
Posts: 97
Joined: Mon Sep 22, 2008 5:10 pm

Re: PrintJobHandler with Possible Threading Issue

Post by JDavis »

John, turns out our fix with the BeginInvoke wasn't rolled out correctly to the client machines - once it was rolled out it appears that this has fixed the issue with no errors being logged for the past few days.

Thanks.
Post Reply