[GeoNetwork-devel] Development Proposal: Jeeves extension tohandle Datasource [SEC=UNCLASSIFIED]

Hi Francois,
This approach means that connection pooling is handled by the application
server, not the application. You need to read the server vendors
documentation for more options. At Geoscience Australia we deploy to Tomcat
5.5. It uses DBCP as its connection pool implementation. DBCP supports
validation queries (and would solve your problem).

http://commons.apache.org/dbcp/configuration.html

Jetty seems to offer more choice in that it will work with several connection
pooling frameworks, DBCP included. You do need to perform more configuration.

http://docs.codehaus.org/display/JETTY/DataSource+Examples

In short, this proposal has the potential to solve your problem. However, it
depends on your servlet containers connection pool implementation.

Regards,
Stephen

-----Original Message-----
From: Francois-Xavier Prunayre
[mailto:francois-xavier.prunayre@anonymised.com]
Sent: Wednesday, 27 August 2008 5:34
To: Davies Stephen
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Development Proposal: Jeeves extension
tohandle Datasource [SEC=UNCLASSIFIED]

Hi Stephen, this sounds to be a good option.

I'm wondering if this approach will solve issue I have when restarting a
database. For instance with mysql, using ?autoReconnect=true in
connection string will allow jeeves to get the connection back. Using
Oracle, it sounds that no such option exist. Anyone facing the same
issue ?

It looks like some connection pool implementations use a validation
query ("SELECT 1 FROM DUAL") to test the connection on Oracle.

Thanks.
Francois

On mer, 2008-08-27 at 17:08 +1000, Stephen.Davies@anonymised.com wrote:

Extend the Jeeves resource provider framework to enable use of JDBC
Datasource ¶

Date

2008/08/27

Contact(s)

Stephen Davies

Last edited

Wed Aug 27 02:44:40 2008

Status

Draft

Assigned to release

to be determined

Resources

Available

Overview ¶

Deployment to multiple enviroments (e.g. development, test and
production) currently requires changes to the config.xml file at each
deployment stage. J2EE provides the javax.sql.Datasource mechanism as
a way to externally define database connection settings. Modify Jeeves
so that external connection pool provided by Web container is used.

Proposal Type ¶

      * Type: Core Change
      * App: Jeeves
      * Module: Resources framework

Links ¶

      * Documents:
      * Email discussions:
      * Other wiki discussions:

Voting History ¶

      * Not voted
                                   
______________________________________________________________________

Motivations ¶

Simplify deployment in a multi stage environment. Externally specify
database settings using J2EE standard facilities.

Proposal ¶

Simplify configuration by moving database settings to external
location. Currently use of config.xml looks like this:

<resource enabled="false">

      <name>main-db</name>

      <provider>jeeves.resources.dbms.DbmsPool</provider>

      <config>

            <user>@db.userid@</user>

            <password>@db.password@</password>

            <driver>oracle.jdbc.OracleDriver</driver>

            <url>jdbc:oracle:thin:@@db.instance@</url>

            <poolSize>10</poolSize>

      </config>

</resource>

Proposal is to extend Jeeves so that the following configuration will
also work:

<resource enabled="true">

      <name>main-db</name>

      <provider>jeeves.resources.dbms.DataSourceProvider</provider>

      <config>

            <jndiName>jdbc/GeonetDS</jndiName>

            <vendor>oracle</vendor>

      </config>

</resource>

The definition of the datasource is server specific. In Tomcat this
can be achieved like this:

<Resource name="jdbc/GeonetDS"auth="Container"
type="javax.sql.DataSource"

username="user"

     password="password"

     driverClassName="oracle.jdbc.OracleDriver"

     url="jdbc:oracle:thin:@myhost.agso.gov.au:1521:dev"

     removeAbandoned="true"

     removeAbandonedTimeout="60"

     logAbandoned="true"

/>

Backwards Compatibility Issues ¶

None. Existing configuration using config.xml will continue to work.

Risks ¶

None.

Participants ¶

      * Stephen Davies, Geoscience Australia

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's

challenge

Build the coolest Linux based applications with Moblin SDK & win great

prizes

Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ GeoNetwork-devel mailing

list GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel GeoNetwork
OpenSource is maintained at http://sourceforge.net/projects/geonetwork