﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » Enterprise Server - V1 » How do I?  » calling ThreadManager.StopAllExecutingThreads() when opening new form</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 13 May 2026 05:16:06 GMT</lastBuildDate><ttl>20</ttl><item><title>calling ThreadManager.StopAllExecutingThreads() when opening new form</title><link>http://forum.strataframe.net/FindPost29901.aspx</link><description>When my main mdi form opens I use the threadmanager to asynchronously retrieve some status information from the database to display on the form.&lt;br/&gt;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&amp;nbsp; 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.&lt;br/&gt;&lt;br/&gt;In the main form I call in the load event:&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.AESPPMMainThreadManager.AddProcess(AddressOf WebSiteDataModificationsReporter.GetEnrollmentStatus, "tdEnrollmentStatus")&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Me.AESPPMMainThreadManager.AddProcess(AddressOf WebSiteDataModificationsReporter.GetOnePayTransactionUpdates, "tdOnePayTransactions")&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;br/&gt;then in the click event of the button that opens the child form:&lt;br/&gt;&amp;nbsp;&amp;nbsp; &lt;br/&gt;&amp;nbsp;&lt;span style="font-weight: bold;"&gt;Private Sub tsbDataManagement_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbDataManagement.Click&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; If Me.CheckPermission("Export Data") Or Me.CheckPermission("Import Data") Then&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Me.AESPPMMainThreadManager.StopAllExecutingThreads()&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Me.LoadForm(GetType(AESPPM.Main))&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; End Sub&lt;/span&gt;&lt;br/&gt;&lt;span&gt;&lt;br/&gt;Then in the load event of the child form:&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&lt;span style="font-weight: bold;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Me.ThreadManager1.AddProcess(AddressOf WebSiteDataModificationsReporter.GetEnrollmentStatus, "tdEnrollmentStatus")&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Me.ThreadManager1.AddProcess(AddressOf WebSiteDataModificationsReporter.GetOnePayTransactionUpdates, "tdOnePayTransactions")&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;Basically it's calling the same methods again, retrieving the same data (checking to see if it has updated).&lt;br/&gt;Once the call in the parent form has aborted, however,&amp;nbsp; the child form can't access the internet at all whether through sync or async calls.&lt;br/&gt;&lt;br/&gt;What might I be missing?&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;&lt;br/&gt;Marcel&lt;br/&gt;&lt;/span&gt;</description><pubDate>Fri, 06 May 2011 14:10:42 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: calling ThreadManager.StopAllExecutingThreads() when opening new form</title><link>http://forum.strataframe.net/FindPost29957.aspx</link><description>I guess a simple app is a little more involving than I thought. &lt;br/&gt;&lt;br/&gt;Let me try rephrasing the question again. First, this question is based on the fact that a customer might have a &lt;span style="font-weight: bold;"&gt;slow connection&lt;/span&gt; (satellite).&lt;br/&gt;&lt;br/&gt;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)?&amp;nbsp; Silently Fail? Has this been tested?&lt;br/&gt;&lt;br/&gt;My problem is, I'm seeing it lock up all future ES requests, including those not wrapped in a threadmanager thread.&amp;nbsp; &lt;br/&gt;&lt;br/&gt;I can probably figure out what I'm doing wrong if I know what is supposed to happen.&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;&lt;br/&gt;Marcel</description><pubDate>Fri, 06 May 2011 14:10:42 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: calling ThreadManager.StopAllExecutingThreads() when opening new form</title><link>http://forum.strataframe.net/FindPost29953.aspx</link><description>I'll try to create a simple one asap.&lt;br/&gt;&lt;br/&gt;Thanks for the response.&lt;br/&gt;&lt;br/&gt;Marcel</description><pubDate>Thu, 05 May 2011 20:53:27 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: calling ThreadManager.StopAllExecutingThreads() when opening new form</title><link>http://forum.strataframe.net/FindPost29950.aspx</link><description>Not a dumb question, just a perplexing one (for me anyway). &lt;span&gt;:blink:&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;Could you post a sample that reproduces the issue?&amp;nbsp; That would speed things up a lot.</description><pubDate>Thu, 05 May 2011 13:06:36 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: calling ThreadManager.StopAllExecutingThreads() when opening new form</title><link>http://forum.strataframe.net/FindPost29948.aspx</link><description>No answer, or dumb question? </description><pubDate>Thu, 05 May 2011 13:00:47 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: calling ThreadManager.StopAllExecutingThreads() when opening new form</title><link>http://forum.strataframe.net/FindPost29907.aspx</link><description>In other words.&amp;nbsp; How can you cancel an es call to retrieve data, so it will be safe to cancel the threadmanager thread it is running on?&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;&lt;br/&gt;Marcel</description><pubDate>Fri, 22 Apr 2011 15:50:00 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item></channel></rss>