calling ThreadManager.StopAllExecutingThreads() when opening new form


Author
Message
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
When my main mdi form opens I use the threadmanager to asynchronously retrieve some status information from the database to display on the form.
If the task in the main form isn't completed and I tell the threadmanager in the main form form to StopAllExecutingThreads(), I can't  make any remote database calls through es in the child form. The child form also has a threadmanager, but synchronous calls don't work either.

In the main form I call in the load event:
        Me.AESPPMMainThreadManager.AddProcess(AddressOf WebSiteDataModificationsReporter.GetEnrollmentStatus, "tdEnrollmentStatus")
        Me.AESPPMMainThreadManager.AddProcess(AddressOf WebSiteDataModificationsReporter.GetOnePayTransactionUpdates, "tdOnePayTransactions")

then in the click event of the button that opens the child form:
  
 Private Sub tsbDataManagement_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbDataManagement.Click
        If Me.CheckPermission("Export Data") Or Me.CheckPermission("Import Data") Then
            Me.AESPPMMainThreadManager.StopAllExecutingThreads()
            Me.LoadForm(GetType(AESPPM.Main))
        End If
   End Sub

Then in the load event of the child form:

            Me.ThreadManager1.AddProcess(AddressOf WebSiteDataModificationsReporter.GetEnrollmentStatus, "tdEnrollmentStatus")
            Me.ThreadManager1.AddProcess(AddressOf WebSiteDataModificationsReporter.GetOnePayTransactionUpdates, "tdOnePayTransactions")

Basically it's calling the same methods again, retrieving the same data (checking to see if it has updated).
Once the call in the parent form has aborted, however,  the child form can't access the internet at all whether through sync or async calls.

What might I be missing?

Thanks,

Marcel

Edited 13 Years Ago by Marcel Heitlager
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
In other words.  How can you cancel an es call to retrieve data, so it will be safe to cancel the threadmanager thread it is running on?

Thanks,

Marcel
Edited 13 Years Ago by Marcel Heitlager
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
No answer, or dumb question?
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Not a dumb question, just a perplexing one (for me anyway). Blink

Could you post a sample that reproduces the issue?  That would speed things up a lot.
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
I'll try to create a simple one asap.

Thanks for the response.

Marcel
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
I guess a simple app is a little more involving than I thought.

Let me try rephrasing the question again. First, this question is based on the fact that a customer might have a slow connection (satellite).

If you use ES to retrieve data and you wrap that request in a threadmanager thread, what happens to that request if you stop all the threads and ES hasn't finished processing that request yet? What is it supposed to do (in theory)?  Silently Fail? Has this been tested?

My problem is, I'm seeing it lock up all future ES requests, including those not wrapped in a threadmanager thread. 

I can probably figure out what I'm doing wrong if I know what is supposed to happen.

Thanks,

Marcel
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search