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

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:

main-db

jeeves.resources.dbms.DbmsPool

@db.userid@

@db.password@

oracle.jdbc.OracleDriver

jdbc:oracle:thin:@@db.instance@

10

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

main-db

jeeves.resources.dbms.DataSourceProvider

jdbc/GeonetDS

oracle

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

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