473,386 Members | 1,793 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,386 software developers and data experts.

SQLConnection Dillema

The dilema is simple:

Documents tell you to paranoically close your connections as soon as you are
done with them, to release resources, though I fail to see how much impact
an open connection on a sql server has both for client and server or even
the network.

Now I have an application that besides all the other tasks, such as
inserting records and looking up records, has a "real time" counter. Since
it is a multi-user scenario, this counter has to periodically be updated by
a select count on a table.

So, do I go by the books and, every 5 seconds when I need a new count, I
open a connection, fetch the count, and then close it again or I just keep
an open connection for that? IŽd use another connection for the inserting
process due to threading issues.

the sqlconnection object connects really fast to sql as compared to ADO, in
my own experience, but the delay seems to appear when you move to a
production environment where there is network traffic, the sql server is
being hit by monster queries from SAP or Peoplesoft or whatever.

Anyone?
Jul 21 '05 #1
3 1313
Cablito,

Do you think you have with these messages enough for some days as answer on
your question?

http://tinyurl.com/5djng

I selected them to only one person (with the most complete answers about
this subject)

I hope this helps?

Cor

"Cablito" <ca*****@dontspam.com>
The dilema is simple:

Documents tell you to paranoically close your connections as soon as you
are
done with them, to release resources, though I fail to see how much impact
an open connection on a sql server has both for client and server or even
the network.

Now I have an application that besides all the other tasks, such as
inserting records and looking up records, has a "real time" counter. Since
it is a multi-user scenario, this counter has to periodically be updated
by
a select count on a table.

So, do I go by the books and, every 5 seconds when I need a new count, I
open a connection, fetch the count, and then close it again or I just keep
an open connection for that? IŽd use another connection for the inserting
process due to threading issues.

the sqlconnection object connects really fast to sql as compared to ADO,
in
my own experience, but the delay seems to appear when you move to a
production environment where there is network traffic, the sql server is
being hit by monster queries from SAP or Peoplesoft or whatever.

Anyone?

Jul 21 '05 #2
Thanks for the answer... geeses is my english comprehention that bad or do
you write like yoda talks?

jk... thanks!

"Cor Ligthert" <no************@planet.nl> escreveu na mensagem
news:OK**************@TK2MSFTNGP12.phx.gbl...
Cablito,

Do you think you have with these messages enough for some days as answer on your question?

http://tinyurl.com/5djng

I selected them to only one person (with the most complete answers about
this subject)

I hope this helps?

Cor

"Cablito" <ca*****@dontspam.com>
The dilema is simple:

Documents tell you to paranoically close your connections as soon as you
are
done with them, to release resources, though I fail to see how much impact an open connection on a sql server has both for client and server or even the network.

Now I have an application that besides all the other tasks, such as
inserting records and looking up records, has a "real time" counter. Since it is a multi-user scenario, this counter has to periodically be updated
by
a select count on a table.

So, do I go by the books and, every 5 seconds when I need a new count, I
open a connection, fetch the count, and then close it again or I just keep an open connection for that? IŽd use another connection for the inserting process due to threading issues.

the sqlconnection object connects really fast to sql as compared to ADO,
in
my own experience, but the delay seems to appear when you move to a
production environment where there is network traffic, the sql server is
being hit by monster queries from SAP or Peoplesoft or whatever.

Anyone?


Jul 21 '05 #3
Cablito,

Sometimes I loose some words when I am typing, when I than reread it, than I
see as well often that I can go directly in Star Wars. However sometimes I
correct it afterwards that much that it is the same unreadable. (not to
mention the to one person what had to be from one )

However in my opinion are there more than enough answers in those messages
which answer completly your questions.

:-)

Cor
Thanks for the answer... geeses is my english comprehention that bad or do
you write like yoda talks?

jk... thanks!

"Cor Ligthert" <no************@planet.nl> escreveu na mensagem
news:OK**************@TK2MSFTNGP12.phx.gbl...
Cablito,

Do you think you have with these messages enough for some days as answer

on
your question?

http://tinyurl.com/5djng

I selected them to only one person (with the most complete answers about
this subject)

I hope this helps?

Cor

"Cablito" <ca*****@dontspam.com>
> The dilema is simple:
>
> Documents tell you to paranoically close your connections as soon as
> you
> are
> done with them, to release resources, though I fail to see how much impact > an open connection on a sql server has both for client and server or even > the network.
>
> Now I have an application that besides all the other tasks, such as
> inserting records and looking up records, has a "real time" counter. Since > it is a multi-user scenario, this counter has to periodically be
> updated
> by
> a select count on a table.
>
> So, do I go by the books and, every 5 seconds when I need a new count,
> I
> open a connection, fetch the count, and then close it again or I just keep > an open connection for that? IŽd use another connection for the inserting > process due to threading issues.
>
> the sqlconnection object connects really fast to sql as compared to
> ADO,
> in
> my own experience, but the delay seems to appear when you move to a
> production environment where there is network traffic, the sql server
> is
> being hit by monster queries from SAP or Peoplesoft or whatever.
>
> Anyone?
>
>



Jul 21 '05 #4

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

Similar topics

1
by: Donnie Darko | last post by:
I'm trying to understand SqlConnection(), SqlCommand() For example. I use SqlConnection() as a parameter when I create a new SqlCommand. Then I open SqlConnection(), then I execute the...
4
by: The Coolest Dolphin | last post by:
Hi all, I have a question/problem concerning usage of my sqlconnection throughout my program. In my main form (frmMain) I defined an sqlconnection (I've set the connection public so that I can...
17
by: LP | last post by:
Hello, Here's the scenario: Object A opens a Sql Db connection to execute number of SqlCommands. Then it needs to pass this connection to a constructor of object B which in turn executes more...
1
by: Mark | last post by:
I have an SqlConnection object defined as a member of main form. I also have a thread that creates an SqlDataReader but uses the same SqlConnection object. The SqlDataReader simple loops round for...
4
by: Steve Richter | last post by:
I really miss c++ .... I have an SqlConnection object within my Web.UI.Page object. The thinking is that the connection to the database server is opened once when the page starts to do its...
3
by: Cablito | last post by:
The dilema is simple: Documents tell you to paranoically close your connections as soon as you are done with them, to release resources, though I fail to see how much impact an open connection...
9
by: Roman | last post by:
Hello I have a component built in VB.2003. It has the following property: Public Shared mCONN As SqlConnection Public Property Connection() As SqlConnection Get Return mCONN End Get...
1
by: jinfeng_Wang | last post by:
hi, I have a question about the difference between SqlConnection.IDisposable.Dispose() and SqlConnection.Dispose(). Both of them realize the function of releasing the connection to the...
4
by: Victor | last post by:
Hi Guys I have a problem here. I want to improve the performance for a website. When I looked into the system, I have found that the system made the "SqlConnection Object" static. That mean only...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
0
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...

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.