473,811 Members | 3,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connections

im writing a service that will be on a app server
this is one of many service's to process Recordsets from Sql Server...
1 service may have 20 Processes to Complete
example
main class PreProcess()
method CleanNames();
method updateNames();
methodr ValidateContrac ts();
Various things must be completed
Suedo Example below
My question is
in the main class make my connection and keep it for all sub members
or connect in each member
A. This Way opens connection...cl oses connect

method cleanNames()
1 get connection
2 get recordset
3. Close Connection
4 process Recordset
5. Open Connection
4 Commit Changes
6. Close Connection()
finished cleanames()
or
method cleanNames()
1 get connection
2 get recordset
3 process Recordset
4 Commit Changes
5. Close Connection()
finished cleanames()
or
this final way is in the parent Class or Calling Function
sends in the connections holds it open till the service is
completed of all jobs its Suppose to do
then releases the connection

method cleanNames(ocon n) connection as parameter
1 get recordset
2 process Recordset
3 Commit Changes
finished cleanames()

Thanks
DaveP
Mar 28 '07 #1
2 1316
If you only need the connection briefly to read a few data, then spend a lot
of time processing these data, and then need the connection briefly again,
then it is better to close the connection while it is not in use. In this
way you free the server to use the connection for other processes, and if
every program does this the total nuber of connections needed on the server
will be smaller than if every process keeps the connections open all the
time. Don't worry about the overhead of "reopening" the connection when you
need it again; the connection pool will automatically take care of
minimizing the actual opening and closing of connections.
"DaveP" <dv*****@sbcglo bal.netwrote in message
news:IY******** *******@newssvr 17.news.prodigy .net...
im writing a service that will be on a app server
this is one of many service's to process Recordsets from Sql Server...
1 service may have 20 Processes to Complete
example
main class PreProcess()
method CleanNames();
method updateNames();
methodr ValidateContrac ts();
Various things must be completed
Suedo Example below
My question is
in the main class make my connection and keep it for all sub members
or connect in each member
A. This Way opens connection...cl oses connect

method cleanNames()
1 get connection
2 get recordset
3. Close Connection
4 process Recordset
5. Open Connection
4 Commit Changes
6. Close Connection()
finished cleanames()
or
method cleanNames()
1 get connection
2 get recordset
3 process Recordset
4 Commit Changes
5. Close Connection()
finished cleanames()
or
this final way is in the parent Class or Calling Function
sends in the connections holds it open till the service is
completed of all jobs its Suppose to do
then releases the connection

method cleanNames(ocon n) connection as parameter
1 get recordset
2 process Recordset
3 Commit Changes
finished cleanames()

Thanks
DaveP
Mar 28 '07 #2
Thanks Alerto
daveP

"Alberto Poblacion" <ea************ *************** ***@poblacion.o rgwrote
in message news:u6******** ******@TK2MSFTN GP06.phx.gbl...
If you only need the connection briefly to read a few data, then spend a
lot of time processing these data, and then need the connection briefly
again, then it is better to close the connection while it is not in use.
In this way you free the server to use the connection for other processes,
and if every program does this the total nuber of connections needed on
the server will be smaller than if every process keeps the connections
open all the time. Don't worry about the overhead of "reopening" the
connection when you need it again; the connection pool will automatically
take care of minimizing the actual opening and closing of connections.
"DaveP" <dv*****@sbcglo bal.netwrote in message
news:IY******** *******@newssvr 17.news.prodigy .net...
>im writing a service that will be on a app server
this is one of many service's to process Recordsets from Sql Server...
1 service may have 20 Processes to Complete
example
main class PreProcess()
method CleanNames();
method updateNames();
methodr ValidateContrac ts();
Various things must be completed
Suedo Example below
My question is
in the main class make my connection and keep it for all sub members
or connect in each member
A. This Way opens connection...cl oses connect

method cleanNames()
1 get connection
2 get recordset
3. Close Connection
4 process Recordset
5. Open Connection
4 Commit Changes
6. Close Connection()
finished cleanames()
or
method cleanNames()
1 get connection
2 get recordset
3 process Recordset
4 Commit Changes
5. Close Connection()
finished cleanames()
or
this final way is in the parent Class or Calling Function
sends in the connections holds it open till the service is
completed of all jobs its Suppose to do
then releases the connection

method cleanNames(ocon n) connection as parameter
1 get recordset
2 process Recordset
3 Commit Changes
finished cleanames()

Thanks
DaveP

Mar 28 '07 #3

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

Similar topics

3
2790
by: Randell D. | last post by:
Folks, I currently connect to my db with PHP code that uses non-persistent connections. I've read that persistent connections can help performance since a connection to the db will use an existing unused connection. If my system was to go through a busy period whereby I seen an extra 50% or more activity for ten minutes or so, would the extra connections stay alive for ever or is there a time limit of inactivity? Would the unused...
3
2415
by: Mudge | last post by:
Hi, My hosting provider only allows me to use 50 connections to my MySQL database that my Web site will use. I don't know what this 50 connections means exactly. Does this mean that only 50 visitors to my Web site can access my database through my Web site at one time? Or does this mean that in my code I can only use 50 connections? and like
4
4179
by: Angelos | last post by:
I get this error mysql_pconnect Too many connections ... every now and then. Does anyone knows where it comes from ? There are a lot of sites running on the server and all of them use the Database frequently. Is there any configuration that I will have to do to my server in order to handle the load ? Thank you... I would appreciate answers from someone that already experienced that
1
2569
by: C Sharp beginner | last post by:
I'm sorry about this verbose posting. This is a follow-up to my yesterday's posting. Thanks William for your reply. I understand it is a good practice to open connections as late as possible and close them as early as possible. My requirement is as follows: I'm developing a class library that will be instantiated by a COM component. My class library contains functions that perform lot of mathematical calculations and read a lot of data...
2
2127
by: Bob | last post by:
We have a production web site that's data intensive (save user input to DB and query for displaying) with the ASP.NET app part on one W2K server and SQL 2000 DB on another W2K server. I have set up performance logs to log # of pooled database connections on the web server every 60 seconds (.NET CLR Data(_global_)\SqlClient: Current # pooled connections). The # of connections is constantly higher than the # of active ASP.NET sessions....
17
8457
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're using crystal reports 9 and vb.net and we're using the crystalrepotViewer to show our reports. But every time we open a report the connection to or sql server remains, so if I open 5 forms with the report viewer I've got 5 sleeping connections in...
4
6067
by: elyob | last post by:
Not really tried going two ways at once, but I have an include_once connection to a mysql_database, now I need to retrieve info from a second mysql_database .. My mysql_connects are getting confused. So, (I've had a couple of beers), am I opening up too many at once? I'll look again in the morning, but am thinking that it is a bad idea to leave two connections open all the time ...
1
13687
by: marcfischman | last post by:
Please help. I have a website running on a linux/apache/mysql/php server. I receive about 8,000-10,000 visitors a day with about 200,000 to 300,000 page views. The server is a RedHat Linux server running PHP 5.x, MySQL 5.x, Apache 2.x We have been suffering from a number of performance issues. Our hosting company has set our max connections to 100, and we are using persistent connections in PHP. At times the mysqld process takes 100%...
13
1775
by: PRP | last post by:
Hi, Our DBA has complained about the large number of connections from the aspnet_wp process. We have multiple web applications deployed in different virtual directories. I read that the way ADO.NET in-built connection pool works is per app domain. So in a scenario where I am using single connection string (from web.config) and I am closing all connections as recommended, is it correct to assume that ideal number of connections
5
3402
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use netstat viewer to see if there is any connection open left, I always see that there are 2 connections open and in "ESTABLISHED" state. Here is the piece of code that I'm using, please tell where I'm doing it wrong. Since this class is being used at many placed in my actual web based application that...
0
9731
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
10651
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
10405
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
10136
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...
1
7671
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
6893
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
5556
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...
1
4342
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
3
3020
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.