Re: DBCP multiple pools for multiple contexts under 4.0.4?

2002-08-19 Thread Isaac Arias

Glenn, Asar,

In the meantime, I created another DataSourceFactory
called a named datasource factory. It's simply a
factory that keeps track of DataSource objects in a
Hashtable keyed by a name passed in from the
server.xml Reference Param block.

If another context tries to reference a DataSource
with the same name, the factory will look it up in the
Hastable and return the existing DataSource. It's not
a very glamorous approach, but it seems to work for
now. In particular, chaching DataSource object at the
Factory level might not be a good idea.

I'm attaching the file here in case it is of interest
or use to anyone on the list, although the Commons
mailing list is probably a more appropriate place to
post it.

If you have any ideas or comments about this approach,
I'd be very interested in reading them.

Thnaks,

Ike
__
Isaac Arias - CTO
Tokenzone, Inc.

--- [EMAIL PROTECTED] wrote:
 
 Only it doesn't work in 4.1.x!!
 
 See

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11662
 
 
 On 17/08/2002 03:20:17 Glenn Nielsen wrote:
  No, I don't.
 
  The Host DefaultContext only defines the default
 context configuration.
  Any resources defined are instantiated for each
 individual context.
 
  GlobalNamingResource does indeed instantiate a
 resource which can
  be shared.
 
  So no, you can't do what you want to do with
 Tomcat 4.0.x.
 
  You would have to upgrade to 4.1.x.
 
  Regards,
 
  Glenn
 
  Isaac Arias wrote:
   Hi All,
  
   A couple of weeks ago I wrote about a Poolman
   DataSource factory for Tomcat, but the latest
 version
   of Poolman ended up being too buggy for
 production
   work. We've since moved to DBCP from Commons.
  
   I'm trying to configure a global DB pool for
 multiple
   contexts and I'm having trouble using the
   BasicDataSourceFactory with Tomcat 4.0.4.
  
   Since Tomcat 4.0.x doesn't support the
   GlobalNamingResources structure (like 4.1.x)
 which
   sounds like the right thing to use, I'm placing
 the
   DBCP Resource in a DefaultContext. However,
 it
   appears that every time a context tries to
 access the
   pool, DBCP creates a brand new pool for that
 context
   instead of sharing a global one.
  
   Any ideas on how to configure this on 4.0.4? I
 guess
   one option would be to modify the
   BasicDataSourceFactory, but maybe there's a way
 to do
   it in the config files in 4.0.4. Is anybody
 using DBCP
   as a global pooler for multiple contexts?
  
   Thanks a lot!
  
   Ike
   _
   Isaac Arias
   Tokenzone, Inc.
  
  
 __
   Do You Yahoo!?
   HotJobs - Search Thousands of New Jobs
   http://www.hotjobs.com
  
   --
   To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 
  --
  To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 

-
 ---
 Visit our Internet site at
 http://www.reuters.com
 
 Any views expressed in this message are those of 
 the  individual
 sender,  except  where  the sender specifically
 states them to be
 the views of Reuters Ltd.
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com


NamedDataSourceFactory.java
Description: NamedDataSourceFactory.java

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


DBCP multiple pools for multiple contexts under 4.0.4?

2002-08-16 Thread Isaac Arias

Hi All,

A couple of weeks ago I wrote about a Poolman
DataSource factory for Tomcat, but the latest version
of Poolman ended up being too buggy for production
work. We've since moved to DBCP from Commons.

I'm trying to configure a global DB pool for multiple
contexts and I'm having trouble using the
BasicDataSourceFactory with Tomcat 4.0.4.

Since Tomcat 4.0.x doesn't support the
GlobalNamingResources structure (like 4.1.x) which
sounds like the right thing to use, I'm placing the
DBCP Resource in a DefaultContext. However, it
appears that every time a context tries to access the
pool, DBCP creates a brand new pool for that context
instead of sharing a global one.

Any ideas on how to configure this on 4.0.4? I guess
one option would be to modify the
BasicDataSourceFactory, but maybe there's a way to do
it in the config files in 4.0.4. Is anybody using DBCP
as a global pooler for multiple contexts?

Thanks a lot!

Ike
_
Isaac Arias
Tokenzone, Inc.

__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




Any interest in a Poolman DataSource Factory class?

2002-07-22 Thread Isaac Arias

Hi,

I know that Tomcat is moving towards using the commons
db pool but there may be some people still using the
Poolman package to do connection pooling.

I created a PoolmanDataSourceFactory that can be
plugged into Tomcat 4.0.x and Tomcat 4.1.x to provide
Poolman managed pools through the Tomcat JNDI context.
This is a good way to transition projects into the
J2EE recommended JNDI/DataSource approach without
breaking old code that uses other Poolman APIs.

If there's any interest I'll be happy to send the file
over to whoever needs it.

Take care,

Ike

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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