472,090 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Database server connection

I am trying to using sqlserver as back-end for an application(web) running
on the window 2X, one thing I am not sure is that once I establish the
connection between database server and application, should I keep this
connection open while application is running, or only open it when
there is a requet to qury records from database?

Thanks for your help.
Jul 20 '05 #1
2 1247

"Leon" <pe*******@hotmail.com> wrote in message
news:89**************************@posting.google.c om...
I am trying to using sqlserver as back-end for an application(web) running
on the window 2X, one thing I am not sure is that once I establish the
connection between database server and application, should I keep this
connection open while application is running, or only open it when
there is a requet to qury records from database?

Thanks for your help.


I believe the usual approach is to leave the connection open, to avoid the
overhead associated with opening and closing the connection again and again.
This is one reason for using connection pooling, for example.

You might want to post in a forum for your client library (eg ADO, JDBC) or
development environment (eg ASP, PHP) to see if there are any specific
considerations for your application.

Simon
Jul 20 '05 #2
pe*******@hotmail.com (Leon) wrote in message news:<89**************************@posting.google. com>...
I am trying to using sqlserver as back-end for an application(web) running
on the window 2X, one thing I am not sure is that once I establish the
connection between database server and application, should I keep this
connection open while application is running, or only open it when
there is a requet to qury records from database?

Thanks for your help.


Hi,
This is question basically regarding connection pooling.
Which technology you are using for database acess? like ADO,JDO, JDBc
etc..?
In all these you can create a pool of connections and maintain it. So
the best thing which I feel is ,during boot up of your application
create a pool of connections, store it and use the connection when
needed.
This is purely dependent on your application also.

Some technologies like ADO and JDBC now support disconnected rowsets
also like CachedRowset in Java where internally it will(means
driver/proider) handle reconnecting to the server when a request
comes.

But from performance point of view, better to create connections
during start up.

How many connections? etc depending on the usage of your application
Regards
Zunil
Cordys
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Leon | last post: by
5 posts views Thread by Fred Zuckerman | last post: by
reply views Thread by Wysiwyg | last post: by
4 posts views Thread by Brian Henry | last post: by
reply views Thread by michael ngong | last post: by
reply views Thread by leo001 | last post: by

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.