473,574 Members | 2,953 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 1033

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

Similar topics

1
1474
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
3698
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
5808
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
985
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...
4
2490
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
1897
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...
5
4237
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...
2
1823
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...
126
6654
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...
0
7805
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7726
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...
0
8237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7817
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...
0
8098
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...
0
6454
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...
1
5622
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...
0
5301
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...
0
1060
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...

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.