Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-144

JDBCConfigurationImpl does not support JNDI lookup for non-jta-data-source.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.7
    • jdbc
    • None
    • WebSphere 6.1, DB2 v8.1 and sequences

    Description

      A non-jta-data-source is required for DB2 sequences; however, org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl does not support a JNDI lookup for this data source from the openjpa.ConnectionFactory2Name property as documented (refer to section 5.12 and 4.2.1 of the OpenJPA manual).

      It seems like the same implementation for the jta-data-source should be implemented for the non-jta-data-source. i.e.

      // ADD createConnectionFactory2()
      private DecoratingDataSource createConnectionFactory2()

      { DataSource ds = (DataSource) connectionFactory2.get(); if (ds != null) return setupConnectionFactory(ds, true); ds = (DataSource) super.getConnectionFactory2(); // JNDI lookup if (ds == null) ds = DataSourceFactory.newDataSource(this, true); return setupConnectionFactory(ds, true); }

      // MODIFY this method
      public Object getConnectionFactory2() {
      // override to configure data source
      if (dataSource2 == null)

      { DecoratingDataSource ds = createConnectionFactory2(); dataSource2 = DataSourceFactory.installDBDictionary (getDBDictionaryInstance(), ds, this, true); }

      return dataSource2;
      }

      Attachments

        1. PostPatch-144fix2.txt
          8 kB
          Brad L Vandermoon
        2. PostPatch-144.txt
          8 kB
          Brad L Vandermoon
        3. Only-JTASpecified.txt
          7 kB
          Brad L Vandermoon
        4. Both-JTAandNonJTASpecified.txt
          7 kB
          Brad L Vandermoon
        5. ASF.LICENSE.NOT.GRANTED--openjpa-144-patch-2.jar
          9 kB
          Patrick Linskey
        6. ASF.LICENSE.NOT.GRANTED--openjpa-144-patch.jar
          10 kB
          Patrick Linskey
        7. ASF.LICENSE.NOT.GRANTED--OPENJPA-144-patch.diff
          3 kB
          Patrick Linskey

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bradmoon Brad L Vandermoon
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: