Ya, that could work. I'm not using a Singleton, using
ServletContext context = getServletContext();
pool = (ConnectionPool)(context.getAttribute("conn-pool"));
Similar functionality though.
Anyways, the idea you are talking about would probably work good, but when would you
check for old connections?
Travis
---- Original Message ----
From: "Matthew L. Wright" <[EMAIL PROTECTED]>
Sent: 2001-03-13 11:05:40.0
To: JRun-Talk <[EMAIL PROTECTED]>
Subject: Re: Re: Re: Accessing a variable from errorpage?
Let's see. So you have a Singleton that manages in a pool of connections of
sorts. Everytime a connection is accessed a variable representing the time
it was last accessed is set. If the difference between that variable and
the curren time is greater than Y then you drop the connection. That's more
my preferred method of doing it. There are various ways of implementing
this, I'll detail if you want. Also, what sort of pooling are you using on
the server? This always counts for something but I've found a lot of Java
guys just don't use it. I don't know why, as I always preferred to build my
pooling into the server thereby going right to the heart of where pooling
should be managed. The pooling options on JSP servers themselves are great
in many cases.
Matt
Matthew L. Wright
Java Internet Programmer
Jupiter One
Web World Studios West Coast
www.jupiterone.com
(818) 763-2927
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, March 13, 2001 9:05 AM
Subject: RE: Re: Re: Accessing a variable from errorpage?
> That may work. About timing out. How do you make the connections time
out after a period of no use?
>
> Travis
>
> ---- Original Message ----
> From: "Matthew L. Wright" <[EMAIL PROTECTED]>
> Sent: 2001-03-13 01:05:50.0
> To: JRun-Talk <[EMAIL PROTECTED]>
> Subject: Re: Re: Accessing a variable from errorpage?
>
> Ah, for some reason I thought you were in a testing environ. Do have a
> Singleton bean/class running through RMI to manage connections? This way
> you can timeout connections.
>
> Another option is while creating this Singleton (bean running and accessed
> via RMI as a standing process on the server) name a method that maintains
> and distributes connections, associate the session ID with the connection.
> Carry the session ID as a session based variable (or just pull it as you
> please really) and on the error page check for a property of your
Singleton
> that associates the session ID with the connection object. This way you
> control the amount of connections and can associate who (you could check
to
> see if cutting this connection would cut others sharing the same
connection
> as well) was cut and what connection they were using and if you should cut
> it or keep it as you please.
>
> Hope this helps.
>
> Matt
>
> Matthew L. Wright
> Java Internet Programmer
> Jupiter One
> Web World Studios West Coast
> www.jupiterone.com
> (818) 763-2927
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: "JRun-Talk" <[EMAIL PROTECTED]>
> Sent: Monday, March 12, 2001 4:42 PM
> Subject: RE: Re: Accessing a variable from errorpage?
>
>
> > Problem with that is that you would have one connection per session.
That
> is just unfeasible. 1000 users, 1000 connections, 10000 users.........
> >
> > Travis
> >
> > ---- Original Message ----
> > From: "Matthew L. Wright" <[EMAIL PROTECTED]>
> > Sent: 2001-03-12 17:27:27.0
> > To: JRun-Talk <[EMAIL PROTECTED]>
> > Subject: Re: Accessing a variable from errorpage?
> >
> > Assign the connection to a session based variable then use that variable
> > throughout the site. On the error page close it out. Something of that
> > sort would work great. I have example code along these lines if needed.
> >
> > Matt
> > Matthew L. Wright
> > Java Internet Programmer
> > Jupiter One
> > Web World Studios West Coast
> > www.jupiterone.com
> > (818) 763-2927
> > ----- Original Message -----
> > From: <[EMAIL PROTECTED]>
> > To: "JRun-Talk" <[EMAIL PROTECTED]>
> > Sent: Monday, March 12, 2001 4:16 PM
> > Subject: Accessing a variable from errorpage?
> >
> >
> > > Is there a way to access a variable from the page that threw the
> > exception?
> > >
> > > Because what i'm finding is that when an error occurs, I can't access
my
> > db connection to close it. Anyway around this without having to wrap
> every
> > page in my own try block?
> > >
> > > Travis Reeder
> > > Chief Software Architect
> > > ThinkVirtual
> > >
> > >
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists