OM
> Subject: Re: [ADVANCED-DOTNET] Singleton and Database Connection
> challange
>
> Thanks for this excellent responses. I agree with Ben that code
> consistency
> is important and I am trying to enforce it in my team. Well, the
reason
> I
> posted this code is to see the
[EMAIL PROTECTED]> wrote:
> > > > Many thanks for the clarification, gentelmen.
> > > >
> > > > On 10/17/07, Richard Blewett <[EMAIL PROTECTED]> wrote:
> > > > > Dispose also returns the connection to the connection pool
> > > > >
; > > >
> > > > Regards
> > > >
> > > > Richard Blewett - DevelopMentor
> > > >
> > > > > -Original Message-
> > > > > From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> > > > > [EMAIL PROTECTE
> Regarding ASP.NET, I'm of the school of thought that database
> connections be created at function level; as in, created and destroyed
> many many times (if necessary) throughout the page life-cycle.
>
We do keep the connection "alive" during the page request. We were
seeing too many calls to th
> I personally think that grading the code as A or D is not a good idea. We are
> not
> evaluating a person / dev but the code.
Huh, but the *code* is evaluated, not the person who wrote it...
// Ryan
===
This list is hosted by DevelopMentor® http://www.develop.
pics. [mailto:ADVANCED-
> > > > [EMAIL PROTECTED] On Behalf Of Smotritsky, Alex
> > > > Sent: 16 October 2007 22:01
> > > > To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> > > > Subject: Re: [ADVANCED-DOTNET] Singleton and Database Connection
> > > > cha
connection from the connection pool on open and return it on
> > > close so you get connection pooling for free.
> > >
> > > -Original Message-
> > > From: Discussion of advanced .NET topics.
> > > [mailto:[EMAIL PROTECTED] On Behalf Of
: Discussion of advanced .NET topics. [mailto:ADVANCED-
> > [EMAIL PROTECTED] On Behalf Of Smotritsky, Alex
> > Sent: 16 October 2007 22:01
> > To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> > Subject: Re: [ADVANCED-DOTNET] Singleton and Database Connection
> > challange
> >
&g
ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] Singleton and Database Connection
> challange
>
> The open and close methods of the connection object in ado.net usually
> take the connection from the connection pool on open and return it on
> close so yo
>
> -Original Message-
> From: Discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike Andrews
> Sent: Tuesday, October 16, 2007 2:34 PM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] Singleton and Database Connectio
Mike Andrews
Sent: Tuesday, October 16, 2007 2:34 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Singleton and Database Connection
challange
This is not the place for a singleton and the singleton is not
implemented
correctly since it doesn't take into account any
On 10/16/07, Ben Joyce <[EMAIL PROTECTED]> wrote:
>
> Regarding ASP.NET, I'm of the school of thought that database
> connections be created at function level; as in, created and destroyed
> many many times (if necessary) throughout the page life-cycle.
>
> Just out of interest, is there *any* situ
Regarding ASP.NET, I'm of the school of thought that database
connections be created at function level; as in, created and destroyed
many many times (if necessary) throughout the page life-cycle.
Just out of interest, is there *any* situation of school of thought
where a single application-level c
This is not the place for a singleton and the singleton is not implemented
correctly since it doesn't take into account any race conditions that might
occur with a multi-threaded app such as asp.net. Also you would not want to
dispose of the connection in the singleton since that defeats the purpo
Also whats the point of setting d = null in page unload?
On 10/16/07, Greg Young <[EMAIL PROTECTED]> wrote:
> I would give this a C- or D as well ... not because the Singleton is
> implemented incorrectly but because it shouldn't be a singleton in the
> first place.
>
> 1) whats the point of being
I'm more of a WinForms developer but I would think that a singleton for your
database connection in a Web Application would be a bad idea my
understanding is that by default IIS will service 10 threads at a time so
now you have 10 threads fighting over that database connection.. assuming
it's e
I would give this a C- or D as well ... not because the Singleton is
implemented incorrectly but because it shouldn't be a singleton in the
first place.
1) whats the point of being Disposable? You are a singleton ... if
anyone disposes you you trash your internal state and start returning
a dispos
We are writing an ASP.NET application. We have used singleton for
instantiating a database connection as explained in the following code
sample.
Design thought was to use only one instance of MyDb across all the pages in
this web application. Is this a correct singleton implementation for
Asp.NE
18 matches
Mail list logo