473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reusing command objects.

4
I create a number of Global ADO Commands on Application Load. Every 30 seconds I use these to recreate Recordsets (Most of the RS are not global, so are recreated each time instead of just being refreshed/requeried). Those that are Global in scope can just be refreshed.

My question is, is what I'm doing correct, or should I close and recreated the Command Objects every 30 seconds. Currently I keep about 20 ADO Command Objects constantly active - these have the same connection and because I am not closing and reopening them each time I have Prepared set to True.

The other consideration is that for some of the Commands the parameters never change, but for others the Comand is called multiple times each 30 refresh with different parameters.

Thank you Neon.
Jul 5 '06 #1
3 1814
sashi
1,754 Expert 1GB
Hi there,

well.. opening recordset object whenever you need will be a good programming pratice.. there are a number of things to consider here.. i.e. the load to the database.. goog luck my fren.. :)
Jul 6 '06 #2
neonk
4
Thank you,

the question is however should I keep the CMD objects open all the time, or should I close them and open them again when I need to recreate the Recordset? Or atleast set the connection to nothing after refreshing the recordset and then resetting the connection as required. I do not need to destroy and recreate the CMD objects to achieve this I believe.

I am concerned about the number of open connections and Server load.

Neonk.
Jul 6 '06 #3
BSOB
77
the answer is that for impractical use it doesnt matter. but sashi is right with then "good programming practice". the cmd objects should only be opened just before use and closed just after use. this is to make sure that no strings are left hanging when the program quits. but again, refur to first sentence.
Jul 15 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Roger Binns | last post by:
It appears that xmlrpclib and/or SimpleXMLRPCServer always use new connections for each request. I have been trying to make them reuse the existing connection but can't find where. Is there any...
9
by: Alan | last post by:
Using VC++ (1998) compiler with PFE32 editor in Win2K Pro SP4. (DigitalMars CD on order. ) The program (below) instantiates a class and then deletes it. I would have thought that reusing the...
7
by: Klaus Johannes Rusch | last post by:
Is the following code valid and supported by current implementations? function somename() { this.show = function () { document.write("somename called") } } var somename = new somename();...
4
by: Old Wolf | last post by:
#include <stdio.h> #include <stdarg.h> Is this safe: void foo(const char *fmt, ...) { va_list ap; va_start(ap,fmt);
4
by: Tedb | last post by:
Is there any reason why you can't reuse a delegate object instance versus creating a new one each time? For example in the following scenario I have a DataPoints object with an array of DataPoint...
1
by: karye2004 | last post by:
Hi! I'm trying to access python objects from c++. It works once. Second time it hangs. Does someone have any clue or some example code or pointer? Thanks! /Karim Here are some python...
1
by: vbDavidC | last post by:
Hi, I am fairly new to .net and objects. I learned to create a reader object in method 1, however if I wanted to create multiple select queries in the same module I did not know how to reuse...
2
by: brazil.mg.marcus.vinicius.lima | last post by:
Hi, I'm constructing a query that will performs a lot o datetime calculumns to generate columns. All that operations are dependent of a base calculum that is performed on the query and its...
4
by: Looch | last post by:
All, I created a class in a windows application and I'd like to be able to pass an instance of that class as a method parameter to a web service. The class contains 100 variables. I tried adding...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.