469,570 Members | 1,637 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,570 developers. It's quick & easy.

keeping sql connection open

hello all....
i have one query....
can somebody please tell me advantages and disadvantages of making
connection to sql server open at the start of application and closing it at
the end of application (in windows application or web application) ?
what will be consequences ?
is it a good practice ?
please comment.
actually me and my friend is having argument on this...
he says, dot net have disconnected architecture.... so u dont need to every
time (in ur functions or subroutines where u executes different sql commands)
open or close the connection.
well, what is a good practice ?
what exactly is the meaning of disconnected architecture ?
please comment.
Nov 22 '05 #1
2 1849
An interesting comparison is between clients like Oracle Forms, which connect
for the duration and the .Net client apps which, as you say, generally take
the disconnected approach. This not only means having no persistant db
connection but also things like 'optimisistic locking' where you don't lock
the data you fetch or modify on the client. Instead you check the database at
the point you perform the update/insert/delete to see if anyone else has
changed the data while you've had it in front of you (so to speak) on the
client. Coming from a traditional 'connected' background this does take
getting used to. Something like Oracle Forms will happily stream and cache
millions of rows from a database for you, and lock those you 'touch'.

With web based applications it makes sense to disconnect after each
transaction. The thought of users spread across a network, which could be
global, running an web form application and each one having a persitent
dedicated connection is scary :)

Rob J

"lokee" wrote:
hello all....
i have one query....
can somebody please tell me advantages and disadvantages of making
connection to sql server open at the start of application and closing it at
the end of application (in windows application or web application) ?
what will be consequences ?
is it a good practice ?
please comment.
actually me and my friend is having argument on this...
he says, dot net have disconnected architecture.... so u dont need to every
time (in ur functions or subroutines where u executes different sql commands)
open or close the connection.
well, what is a good practice ?
what exactly is the meaning of disconnected architecture ?
please comment.

Nov 22 '05 #2
hi...
i'm still not satisfied with this answer...
could somebody please explain me in detail... connection pooling...
what will happen if the con.open is declared at the start of application and
con.close at the end of application and do not opening or closing the
connection during any of execution of queries within application...
what wil be effects if its a web application and what will be effects if its
a desktop application...
please help.

"RobJUK66" wrote:
An interesting comparison is between clients like Oracle Forms, which connect
for the duration and the .Net client apps which, as you say, generally take
the disconnected approach. This not only means having no persistant db
connection but also things like 'optimisistic locking' where you don't lock
the data you fetch or modify on the client. Instead you check the database at
the point you perform the update/insert/delete to see if anyone else has
changed the data while you've had it in front of you (so to speak) on the
client. Coming from a traditional 'connected' background this does take
getting used to. Something like Oracle Forms will happily stream and cache
millions of rows from a database for you, and lock those you 'touch'.

With web based applications it makes sense to disconnect after each
transaction. The thought of users spread across a network, which could be
global, running an web form application and each one having a persitent
dedicated connection is scary :)

Rob J

"lokee" wrote:
hello all....
i have one query....
can somebody please tell me advantages and disadvantages of making
connection to sql server open at the start of application and closing it at
the end of application (in windows application or web application) ?
what will be consequences ?
is it a good practice ?
please comment.
actually me and my friend is having argument on this...
he says, dot net have disconnected architecture.... so u dont need to every
time (in ur functions or subroutines where u executes different sql commands)
open or close the connection.
well, what is a good practice ?
what exactly is the meaning of disconnected architecture ?
please comment.

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by lokee | last post: by
12 posts views Thread by marcadonis | last post: by
11 posts views Thread by pradeep_TP | last post: by
2 posts views Thread by MrMike | last post: by
3 posts views Thread by robboll | last post: by
20 posts views Thread by fniles | last post: by
3 posts views Thread by fniles | last post: by
9 posts views Thread by fniles | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.