Hello Anthony,

I use a single(ton) SessionManager of sorts which 'serves' the
connections when asked, something like:

DBSessionManager.getInstance().getSessionRO();
DBSessionManager.getInstance().getSessionRW();

and of course, the corresponding:

DBSessionManager.getInstance().releaseSessionRO(session);
DBSessionManager.getInstance().releaseSessionRW(session);

that return the connections to the pool.

I use that approach with Apache's JackRabbit (not strictly a DB, but
it should be similar) and Apache's Commons Pool for the pool
implementation.

Hope this guides you in the correct direction.

On Sat, Jan 1, 2011 at 11:15 AM, Anthony <[email protected]> wrote:
> I have a class that handles a pool of Oracle DB connections with methods to 
> get and free (return to pool) a connection.
>
> This connection pool class will be instantiated in my class that extends 
> org.restlet.Application.
>
> My question is how to make a connection availble to a ServerResource. Should 
> it be injected or should ServerResource reach out to Application.
>
> Please provide some detail with response - for example, if it should be 
> injected, how do I do that (via a filter perhaps)?
>
> Using Restlet 2.0.4
>
> tia,
> -Anthony
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2695318
>



-- 
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2695362

Reply via email to