GeoServer
  1. GeoServer
  2. GEOS-778

GeoServer JDBC DataStore should be able to use external J2EE/JNDI Connection pools

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0-RC1
    • Fix Version/s: 1.6.0-beta2
    • Component/s: Global
    • Labels:
      None
    • Environment:
      OS : Windows XP SP2 Fr
      JDK : 1.4.2_08-b03
      Using : Geoserver with JBoss 4.0.3SP1
      Hardware : Pentium D
    • Number of attachments :
      1

      Description

      I made some tests to check if GeoServer could be able to use external J2EE/JNDI connection pools instead of its internal one (ConnectionPool class in gt2-main).

      This issue is linked with GEOT-489 I also filled/completed with the following text (resulting of some mails).
      Working on this issue will imply to create a specific issue about Oracle to resolve some Oracle specific difficulties listed below.

      ########################
      Ok, so here is the code we wrote for our tests (5 joined files) :

      • OracleJNDIDataStore.java : an extention of OracleDataStore with specific createConnection and getSqlBuilder methods.
      • OracleJNDIDataStoreFactory : an extention of OracleOCIDataStoreFactory with specific canProcess and createDataStore methods.
      • WithSchemaSQLBuilder : an extention of DefaultSQLBuilder (used by Oracle
      • SDOAttributeIO [oraclespatial] : a file modified to "extract from JBoss connection pool" the underlying OracleConnection (look for WrappedConnection word)
      • OracleFeatureWriter [oraclespatial] : a file modified to "extract from JBoss connection pool" the underlying OracleConnection (look for WrappedConnection word)

      Explanations :

      • JNDI is "just" a directory that handles objects identified by textual keys. JBoss like other J2EE app-servers provides some javax.sql.DataSource trought JNDI.
        Look for InitialContext word in OracleJNDIDataStoreFactory to see how it is used (that is really simple)
      • The parameter of OracleJNDIDataStore are identical (in number and types) to the parameters of OracleDataStore with 2 differences :
      • the dbtype value is 'oracleJ' and not 'oracle'
      • the alias key must be understand like the "JNDI textual id" and not the DB name.
      • WithSchemaSQLBuilder is an other stuff that I wanted to provide later but that already work : the table names (in the FROM part of SQL queries) are prefixed with the user (aka schema) name so tables and data can be accessed in a specific schema (schema key of the datastore) through a "super user" (user key of the datastore) [see also GEOT-1005]
      • SDOAttributeIO and OracleFeatureWriter are the 2 files that I modified to acces the underlying OracleConnection. Here is the bad work because it references some JBoss classes.
        Just take note that the underlying connection can not be used instead of the pool connection : the pool connection (WrappedConnection) is needed to handled some specific methods (like 'close') that helps to manage the pool.

        Issue Links

          Activity

          Hide
          Aksel Hilde added a comment -

          We would also very much like to have this feature. It seems that the changes will be done in GeoTools 2.3.1, when will this then be available in Geoserver?

          Show
          Aksel Hilde added a comment - We would also very much like to have this feature. It seems that the changes will be done in GeoTools 2.3.1, when will this then be available in Geoserver?
          Hide
          Andrea Aime added a comment -

          We have lots on our plate and I don't know if we'll really find the time to do this for gt2 2.3.1.
          Anyways, if it ends up in 2.3.1, it will be included in geoserver 1.5.0, but most probably not in 1.4.x since the change is really big . By change here I mean a complete gt2 connection pooling rewrite, not something specific to Oracle but something that spans all JDBC data stores and can work with all connection pools you can throw at it.
          The fix attached to this issue is effective, but works only with JBOSS connection pools and the Oracle data store.

          Show
          Andrea Aime added a comment - We have lots on our plate and I don't know if we'll really find the time to do this for gt2 2.3.1. Anyways, if it ends up in 2.3.1, it will be included in geoserver 1.5.0, but most probably not in 1.4.x since the change is really big . By change here I mean a complete gt2 connection pooling rewrite, not something specific to Oracle but something that spans all JDBC data stores and can work with all connection pools you can throw at it. The fix attached to this issue is effective, but works only with JBOSS connection pools and the Oracle data store.
          Hide
          Chris Holmes added a comment -

          This was fixed with 1.6-beta2, at least in terms of GeoTools datastores. We still need a UI to let people configure their JNDI stuff, but that should be in a another issue.

          Show
          Chris Holmes added a comment - This was fixed with 1.6-beta2, at least in terms of GeoTools datastores. We still need a UI to let people configure their JNDI stuff, but that should be in a another issue.

            People

            • Assignee:
              Andrea Aime
              Reporter:
              Alcer (Raphael Gaquer)
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: