glassfish
  1. glassfish
  2. GLASSFISH-20886

jbatch reference implementation does not work with oracle database as job repository.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: None
    • Component/s: batch
    • Labels:
      None
    • Environment:

      Windows 7 (though this is almost certainly platform agnostic problem).

      Description

      Steps to reproduce the bug:

      • Have a working instance of the Oracle database with some test schema. Schema name is very important and must be other than APP or JBATCH - in my case it was simply BATCH.
      • Install GlassFish Server Open Source Edition 4.0 with the default domain1 domain.
      • Install Oracle JDBC driver for the target database, i.e. place the driver's JAR file in domain's lib directory.
      • Execute the %GLASSFISH_HOME%\glassfish\lib\install\databases\jsr352-oracle.sql script in the target database schema.
      • Create jdbc connection pool to Oracle database schema, say jdbc/pool/oracle.
      asadmin create-jdbc-connection-pool -e --datasourceclassname oracle.jdbc.xa.client.OracleXADataSource --restype javax.sql.XADataSource --steadypoolsize 2 --maxpoolsize 8 --maxwait 30000 --poolresize 1 --idletimeout 300 --isconnectvalidatereq=true --isolationlevel read-committed --validationmethod table --validationtable DUAL --failconnection=true --allownoncomponentcallers=false --nontransactionalconnections=false --description "Connection pool supporting distributed transactions to BATCH schema in local Oracle database." --property "User=BATCH:Password=BATCH123:URL=jdbc\:oracle\:thin\:@localhost\:1521\:orcl:LoginTimeout=5000:DataSourceName=OracleXADataSource" jdbc/pool/batch
      
      • Create jdbc resource (jdbc/oracle) that wraps the jdbc/pool/oracle
      asadmin create-jdbc-resource --target server --connectionpoolid jdbc/pool/oracle --enabled=true --description "Wrapper for jdbc/pool/oracle JDBC connection pool." jdbc/oracle
      
      • Set jdbc/oracle resource as the target data source for the batch configuration in server instance
      asadmin set-batch-runtime-configuration --datasourcelookupname jdbc/oracle
      
      • Restart domain - not sure if it's necessary, but I think it is.
      • Deploy the webserverlog application from Java EE 7 tutorial - will try to upload app archive.
      • Go to http://localhost:8080/webserverlog/ and click the "Start Batch Job" button - it shall fail with the "java.sql.SQLSyntaxErrorException: ORA-00922: missing or invalid option".

      I spent half of the day tracing the cause of this problem and it seems that the reference batch implementation that is part of the GlassFish server always sets the APP schema on the database connection before proceeding with any database operation, as can be seen in the getConnection method. I found this out by turning on the JDBC driver's logging (by adding the JVM system property -Doracle.jdbc.Trace=true) and adding new logger (logger name: oracle, level: FINEST).

        Activity

        Hide
        Mahesh Kannan added a comment -

        1.0.1-b07 jars are the new jars built from the batch project. You can get them from maven central.
        You don't need to download them separately. They are part of the GlassFish binaries.

        I will update this bug with the GlassFish nightly build that has these new jars.

        Show
        Mahesh Kannan added a comment - 1.0.1-b07 jars are the new jars built from the batch project. You can get them from maven central. You don't need to download them separately. They are part of the GlassFish binaries. I will update this bug with the GlassFish nightly build that has these new jars.
        Hide
        jiggster added a comment -

        OK, great. I assume that the new nightly build will show up under this directory, right? Any idea when it will be available? The last nightly build is from 15-Dec-2014 - there are no nightly builds from 2015...

        Show
        jiggster added a comment - OK, great. I assume that the new nightly build will show up under this directory , right? Any idea when it will be available? The last nightly build is from 15-Dec-2014 - there are no nightly builds from 2015...
        Hide
        smillidge-c2b2 added a comment - - edited

        Mahesh,

        We have a whole load of feature enhancements in Payara related to JBatch, asadmin command support, console changes etc. DB2, Oracle, MySQL Postgres support which we'd love to contribute upstream.

        See http://www.payara.co.uk/jbatch_on_payara_41151_now_supports_5_different for details

        Show
        smillidge-c2b2 added a comment - - edited Mahesh, We have a whole load of feature enhancements in Payara related to JBatch, asadmin command support, console changes etc. DB2, Oracle, MySQL Postgres support which we'd love to contribute upstream. See http://www.payara.co.uk/jbatch_on_payara_41151_now_supports_5_different for details
        Hide
        davidwinters1980 added a comment -

        Payara which is built from GF 4.1 supports up to 5 different database types for the JBatch RI

        Show
        davidwinters1980 added a comment - Payara which is built from GF 4.1 supports up to 5 different database types for the JBatch RI
        Hide
        davidwinters1980 added a comment -

        Link to Payara and where to download: http://payara.co.uk/home

        Show
        davidwinters1980 added a comment - Link to Payara and where to download: http://payara.co.uk/home

          People

          • Assignee:
            Mahesh Kannan
            Reporter:
            jiggster
          • Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: