473,749 Members | 2,432 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 1050

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

Similar topics

1
1481
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
3716
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
5850
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
991
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
2507
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
1918
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
4251
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
1830
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
6725
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
8997
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8833
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
9389
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6801
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
4709
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...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
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.