You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Vincent Frison <tu...@ohmforce.com> on 2004/09/02 21:31:35 UTC
Using OJB in a servlet container
Hi all,
I cannot find info explaining the good way to use OJB in a servlet
environnement. A first basic question could be : can an unique broker instance
stands during all the app/servlet life cycle (i.e. the broker is instancied
once at servlet init) or a new broker should be instancied on each new HTTP
session, or even on each HTTP request (reducing caching benefits I guess)?
Thanks a lot..
PS: I had some difficulties to post to this ML, I'm sorry if this mail is
finally posted many times..
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Using OJB in a servlet container
Posted by Brian McCallister <mc...@forthillcompany.com>.
A broker should be treated much like a JDBC connection. Obtain, use,
close.
I would definitely *not* put an open broker in the session or servlet
context. Caching works across brokers (depending on the cache
implementation used).
-Brian
On Sep 2, 2004, at 3:31 PM, Vincent Frison wrote:
> Hi all,
>
> I cannot find info explaining the good way to use OJB in a servlet
> environnement. A first basic question could be : can an unique broker
> instance
> stands during all the app/servlet life cycle (i.e. the broker is
> instancied
> once at servlet init) or a new broker should be instancied on each new
> HTTP
> session, or even on each HTTP request (reducing caching benefits I
> guess)?
>
> Thanks a lot..
>
> PS: I had some difficulties to post to this ML, I'm sorry if this mail
> is
> finally posted many times..
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org