tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Einfeldt <ralph.einfe...@uptime-isc.de>
Subject AW: Help - Example of RequestDispatcher call.
Date Mon, 09 Oct 2000 17:01:21 GMT
I wouldn't do it that way.

If you really want do do your own pooling, you should
implement the pool or a pool manager as a singleton.

Each servlet could call something like:

  Connection myConnection =
PoolManager.getPool("Poolname").getConnection();
  ...
  PoolManager.getPool("Poolname").freeConnection(myConnection);


If you want to load the pool on startup, define an init method
in the PoolManager an launch a servlet that calls it.

There are several different concepts to do the pooling right.
If you don't need more than one pool you could simplify it.

  Connection myConnection = Pool.getConnection();
  ...
  Pool.freeConnection(myConnection);

Or try one of the ready pool managers around:
http://java.apache.org/turbine/features.html
http://www.javacorporate.com/Products/expresso/dbpooling.html
http://www.javaexchange.com/


> -----Urspr√ľngliche Nachricht-----
> Von: plen@orionsci.com [mailto:plen@orionsci.com]
> Gesendet: Montag, 9. Oktober 2000 17:37
> An: tomcat-user@jakarta.apache.org
> Betreff: Help - Example of RequestDispatcher call.
> 
> 
> Hello,
> 
> I am wondering how (or if) RequestDispatcher can help me with my
> problem.  I have a servlet (dbServlet) that gets loaded when 
> the Tomcat
> starts. It is basically my own database pooler.  Anyway, 
> there are other
> servlets that, when called, I want to get ahold of the dbServlet and
> obtain a new connection.  After my transaction I will need to 
> inform my
> dbServlet to reallocate that connection.  I'm not sure if, or how,
> RequestDispatcher.include could get me my connection object and
> RequestDispatcher.forward could be used to do the reallocation.
> 
> Does anyone know how, or if, I can use RequestDispatcher in 
> this manner?
> 
> Thanks,
> 
> Peter Len
> 

Mime
View raw message