This one time, at band camp, Werner Guttmann said:

WG>On Sun, 12 Jan 2003 20:24:04 -0500, tek1 wrote:
WG>
WG>> > > in a servlet environment, if obtaining a new Database object for each
WG>> > > method (or call from a servlet) is the correct approach, how does this
WG>> > > impact performance since it seems that 1 Database object = 1 database
WG>> > > connection.  if that is the case, should a pool of Database objects be used
WG>> > > in such an environment?  if so, are there any existing projects (i.e.
WG>> > > jakarta commons) that offer such pooling ability?
WG>> >Why not rely on the pooling mechanism of your container, i.e. jboss in
WG>> >your case. Just setup and configure a JDBC connection pool, and make it
WG>> >available to Castor b ytelling Castor to obtain JDBC connections from a
WG>> >specified enrty in a JNDI naming tree ? That way, the overhead
WG>> >associated to obtaining fresh Database instances for each thread should
WG>> >be minimal.
WG>>
WG>> good point.  i will look into this.  in the case where a container is not
WG>> used and thus no pooling, does castor itself provide Database (connection)
WG>> pooling or is that the responsibility of the application using castor?
WG>> just wondering if something like jakarta's commons pool
WG>> (http://jakarta.apache.org/commons/pool.html) should be used in a non-app
WG>> server environment?
WG>
WG>I am not really an expert on using Castor in standalone mode, so I'll
WG>leave it up to others to step in and share their views, but the default
WG>behaviour of Castor in this mode is to use a new JDBC connection (or
WG>Database instance) for each call of JDO.getDatabase().
WG>
WG>Having said that, please have a close look at
WG>http://castor.exolab.org/database-conf.html (The Castor configuration
WG>file) and you'll see that there is three supported modes of telling
WG>Castor how to obtain Database connections. The second one (using the
WG><data-source> element) allows you to use a class that implements the
WG>javax.sql.DataSource interface. That could well be a separate pool
WG>manager implementation or a vendor-specific DataSource implementation
WG>that supports pooling (e.g. IBM's DB2PooledDataSource).

There is a page explaining how to implement JDBC connection pooling
with Castor JDO (http://www.castor.org/pooling.html). Ned started
this document a few months ago and it needs to be expanded much
further. If anyone would like to contribute some docs on the use
other connection poolers that are not listed there please send them
to the list.

Bruce
--

perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to