Monday, March 19, 2012

Open late close early

I'm porting a web based MS Access app (ASP) to MS SQL Server. With Access,
since it isn't multi-user, I always opened the database late and closed it
early in the code. Should I do the same thing with SQL Server or is it OK
to open/close the database at the HTTP session start/end? There will be
about 50 or so concurrent users. Thanks in advance.It's still recommended that you "open late" / "close early" if you're using
any kind of pooled connection library. That way, connections will be able
to stay in the pool as long as possible.
--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Bob Smith" <noemail@.please.com> wrote in message
news:mCrkd.5370$z3.2192@.bignews5.bellsouth.net...
> I'm porting a web based MS Access app (ASP) to MS SQL Server. With
Access,
> since it isn't multi-user, I always opened the database late and closed it
> early in the code. Should I do the same thing with SQL Server or is it OK
> to open/close the database at the HTTP session start/end? There will be
> about 50 or so concurrent users. Thanks in advance.
>|||"Bob Smith" <noemail@.please.com> wrote in message
news:mCrkd.5370$z3.2192@.bignews5.bellsouth.net...
> I'm porting a web based MS Access app (ASP) to MS SQL Server. With
Access,
> since it isn't multi-user, I always opened the database late and closed it
> early in the code. Should I do the same thing with SQL Server or is it OK
> to open/close the database at the HTTP session start/end? There will be
> about 50 or so concurrent users. Thanks in advance.
You don't really have the concept of "open" and "closing" a database in SQL
Server, but in general, you want to keep your actual work with the server
short and sweet. Keeping this attitude will help you avoid unnecessarily
prolonged transactions, blocking, etc.
>|||Hi Bob,
Thanks for your post and thanks for Adam and Greg's
input.
"Open late, close early" is a good practice as this
frees resources while other logic is processing. I
suggest that you refer to this article for more
information:
258939 Recommendations for Connecting to Databases
Through Internet Information
http://support.microsoft.com/?id=258939
If you have any further questions or concerns please
feel free to let us know.
Sincerely,
William Wang
Microsoft Online Partner Support
Get Secure! - <www.microsoft.com/security>
=====================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and
confers no rights.
--
>From: "Bob Smith" <noemail@.please.com>
>Newsgroups: microsoft.public.sqlserver.server
>Subject: Open late close early
>Lines: 7
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
>Message-ID: <mCrkd.5370$z3.2192@.bignews5.bellsouth.net>
>X-Complaints-To: abuse@.bellsouth.net
>X-Abuse-Info: Please forward a copy of all headers for
proper handling
>X-Trace:
ldjgbllpbapjglppdbdpiflmbcekedmfhojhikkbagflhcbongabknppn
iiihliedillphahkfobdkeobjmjdcnmpcaoablghiflhmddniifjhbmkd
mkllegdncmpbddgkbmehoimepnghmlnnpbhhjapgcojabh
>NNTP-Posting-Date: Wed, 10 Nov 2004 11:47:14 EST
>Organization: BellSouth Internet Group
>Date: Wed, 10 Nov 2004 11:49:37 -0500
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwe
bnet.it!tiscali!newsfeed1.ip.tiscali.net!news.glorb.com!b
igfeed.bellsouth.net!bignumber.bellsouth.net!news.bellsou
th.net!bignews5.bellsouth.net.POSTED!1ec21f86!not-for-mai
l
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.sqlserver.server:366921
>X-Tomcat-NG: microsoft.public.sqlserver.server
>I'm porting a web based MS Access app (ASP) to MS SQL
Server. With Access,
>since it isn't multi-user, I always opened the database
late and closed it
>early in the code. Should I do the same thing with SQL
Server or is it OK
>to open/close the database at the HTTP session
start/end? There will be
>about 50 or so concurrent users. Thanks in advance.
>
>

No comments:

Post a Comment