grouper-dev - improved pooling for subject API
Subject: Grouper Developers Forum
List archive
- From: Chris Hyzer <>
- To: Grouper Dev <>, "" <>
- Subject: improved pooling for subject API
- Date: Tue, 16 Sep 2008 01:16:14 -0400
- Accept-language: en-US
- Acceptlanguage: en-US
Hey, Regarding Jira issue: https://bugs.internet2.edu/jira/browse/MCO-14 This is done. Grouper and the subject API no longer need
jakarta db pooling (commons-pool.jar or commons-dbcp.jar), though they can be
used as legacy options if c3p0 doesnt work, or if the implementer chooses. The
db connection factory is pluggable, and another Grouper specific option is to
get the db connection from the Grouper Hibernate pool (Note, this is only
available when running Grouper with the Subject API). This gives the
advantages: 1. You dont have to specify the user/pass multiple times in
multiple files 2. The queries will participate in any open transactions (if
applicable) 3. You will have fewer open connections to your DB at once
since one pool instead of two This is convenient if your grouper data and person source
share a DB (or can be accessed from the same DB (e.g. with a feed or DB link). Should we change the Grouper quick start so it is setup like
this with the user/pass commented out? If you dont make any sources.xml changes, you will be using
the new pooling (C3P0). Again, the reason we are doing this is that hibernate3
doesnt support DBCP anymore, so we might as well not have two types of pools... Here is the Grouper sources.example.xml documentation: <type>person</type> <!--
edu.internet2.middleware.subject.provider.C3p0JdbcConnectionProvider (default)
edu.internet2.middleware.subject.provider.DbcpJdbcConnectionProvider (legacy)
edu.internet2.middleware.grouper.subj.GrouperJdbcConnectionProvider (same settings as grouper.hibernate.properties,
the driver, url, pass, maxActive, maxIdle, maxWait are forbidden --> <init-param> <param-name>jdbcConnectionProvider</param-name> <param-value></param-value> </init-param> All unit tests pass with C3P0 and the Grouper DB source.
Also there is a new unit test in the subject API that throws a dozen threads
each querying the DB to make sure pooling is working. I removed the i2mi-common.jar from the subject API and added
individual jars there. Here is the snippet from the change log to upgrade Grouper: # 2008/09/15: v1.4 HEAD: Subject API converted to use C3P0
pooling instead of DBCP?. * delete: lib/commons-dbcp.jar * delete: lib/commons-pool.jar * update: lib/commons-logging.jar * update: lib/subject-0.3.0-rc1-cvs.jar * compare the sources.xml with the sources.example.xml,
and add the elements and comments about jdbcConnectionProvider. You can leave
the value blank for C3P0, or fill it in. If you are using the same credentials
for grouper and a subject source, remove the credentials from sources.xml and
put edu.internet2.middleware.grouper.subj.GrouperJdbcConnectionProvider as the
jdbcConnectionProvider |
- improved pooling for subject API, Chris Hyzer, 09/16/2008
Archive powered by MHonArc 2.6.16.