Use a threadlocal variable to hold the connection for the current request.
Set the value from your pool using a WebRequestServicerFilter and make sure
you clean it up at the end of the request.

-----Original Message-----
From: Rui Pacheco [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 17, 2006 10:32 AM
To: Tapestry users
Subject: Re: A bit OT: how to manage database connections for multiple
components rendered simultaneously.

Hmmm. I am not using Hibernate, the learning curve is too steep for this
project.

Can you sugest a way to solve this with handwritten code?

On 7/17/06, James Carman <[EMAIL PROTECTED]> wrote:
>
> All code within one request can easily just use one connection.  That's
> what
> we do with Tapernate.
>
> -----Original Message-----
> From: Rui Pacheco [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 17, 2006 10:13 AM
> To: Tapestry users; Tapestry users
> Subject: A bit OT: how to manage database connections for multiple
> components rendered simultaneously.
>
> Hi all
>
> This is not a pure Tapestry question, but I believe you have seen this
> before and might be able to give me some guiding light.
>
> I have a web application, which I am splitting into several fragments, ie,
> components, each one rendering content stored in a database. I just
> realised
> my index page would have 9 such fragments and if each is to retrieve a
> connection from the pool to get its content, the stress on the db server
> might be crazy, even if each request is quite short.
>
> I have a connection pool, but even with that I don't believe its healthy
> to
> use 9 connections at the same time. What about the other users?
>
> How would you deal with this issue?
> --
> Cumprimentos,
> Rui Pacheco
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Cumprimentos,
Rui Pacheco



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to