473,699 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threading Commands

I'm connecting to a DB on a dual-processor 2.8 Ghz server with 2.5 gig RAM.
So I've got plenty of muscle, and I'd like to do double-time on one update
command. The command calls a stored procedure that receives two variables.
I've got the threading class set up, but I keep running into a problem with
the
connection. My threading class copies the command and creates a new
connection for it using the main connection's connect string, but those
connections
don't seem to open correctly. This is the constructor for my AsyncDBCommand
class:

Public Sub New(ByVal Cmd As OleDbCommand, ByVal ParamArray Params() As
Object)

Dim i As Short

Dim obj As Object

Dim p As OleDbParameter

m_Cmd = Cmd

Parameters = Params

End Sub

and the thread initializer:

Public Sub RunCmd()

m_Cmd.Connectio n = New OleDbConnection (RADAR.Connecti onString)

m_Cmd.Connectio n.Open()

m_Thread = New Threading.Threa d(AddressOf Me.DoAsyncCmd)

m_Thread.Start( )

End Sub
This works fine as long as I only call the command once and then use Join.
But if I call it twice in a row, I get an invalid operation error in my
generic command caller on the line where it checks to see if the command
passed to it has an open connection. For some reason, even though I open
the connection from within the AsyncDBCommand class, it reads as Closed and
then can't open. Any suggestions?

Thanks,
Mike
--
Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
847-272-7691
mi************@ radarwire.com
Nov 20 '05 #1
0 1043

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1476
by: Ognjen Bezanov | last post by:
Hi, all Thanks all of you who helped me with the threading and queues issue. I am trying to get it working but I am having problems. When I try to run the following: cmddata = mediaplay.initcommandqueue() #initiates the Queue to send commands down
1
3711
by: amit | last post by:
Hello, I am embedding a python script in a C++ application. The script can be called simultaneously from multiple threads. What is the correct way to implement this situation: 1) Have unique python interpreter instantiations ( Py_Initialize() ) for each thread.
2
5839
by: Vadym Stetsyak | last post by:
Hello! I've got a class, representing Windows Form (Form1); When I launch new thread user interface e.g. Form1 stops responding until the worker thread is completed. So the question - how this can be avoided. Roughly speaking I need to perform some job after the button click and while this job is completing user GUI can respond.
0
988
by: Benoit Martin | last post by:
Hi, I've had my application going back to desktop randomly when executing ShowDialog commands. I posted to this list and was asked to post code but unfortunately I cannot reproduce this problem with a smaller project and I don't want to post my entire app on this list. Anyway, after further troubleshooting it looks like my problem comes from a threading issue. I have my main interface running in the main thread and
4
2496
by: Perecli Manole | last post by:
I have a background worker thread that receives queued work items and processes them. How do I make this background thread go in a sleep state while the queue is empty and then wake back up as soon as there are work items to be performed? To much processor time is being wasted right now checking an empty queue in a loop. Thanks Perry
0
1914
by: richard | last post by:
OS: Winxp and Win2003 Visual Basic.NET 2003 MS-SQL Server 2000 hey all I am a newbie in vb.net but i have managed to build a simple chat server in vb.net using socket and a client connecting to it made in vb6. Some of the code in the server are based on the basic samples that i get from other authors. To give you an idea, the server uses sockets,
5
4245
by: half.italian | last post by:
Hi all, I don't really understand how to properly use threading in my programs, however I have managed to get by so far using them improperly. Once again I have come up to what I think is something that won't work because of the way the program is set up. I have a long running process running underneath a gui in a different thread, and a progress bar that updates the status of the operation. What I would like to do is use something...
2
1829
by: =?Utf-8?B?TWljaGFlbCBNYWVz?= | last post by:
Hello, I have an Mdi-application which also is a remoting-server (Ipc). Several instances can co-exist on the same machine. I have a small app (search-engine) (remoting-client) which calls a sub on the MDI (specific instance) thus retrieving eg the data of a certain customer. If the customer childform is already instanciated, there is no problem. If the destination-childform is not yet open, it will be opened like this:
126
6699
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard: http://www.cse.wustl.edu/~schmidt/ACE.html the same way that the STL (and subsequently BOOST) have been subsumed? Since it already runs on zillions of platforms, they have obviously worked most of the kinks out of the generalized threading and processes idea (along with many...
0
8630
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8944
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8899
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7786
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2016
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.