Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-1449

REMOTE JDBC CacheStore failing upsert on Oracle 12c RAC

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JDG 7.2 ER3
    • JDG 7.2 ER1, JDG 7.2 ER3
    • Server
    • None
    • ER3
    • Reopened by mistake
    • Hide

      1. Clone https://github.com/infinispan/jdg-functional-tests (branch master)
      2. Allocate TWO DBs using this link: http://dballocator.mw.lab.eng.bos.redhat.com:8080/Allocator/AllocatorServlet?operation=allocate&expression=oracle12cRAC%26%26geo_BOS&expiry=1440&requestee=GUI (keep open for later reference)
      3. Download driver from http://www.qa.jboss.com/jdbc-drivers-products/EAP/7.1.0/oracle12cRAC/jdbc4/ojdbc8.jar
      4. Prepare two folders with a copy of JDG server of appropriate version in them
      5. Go to jdg-functional-tests/remote/jdbc-cache-store/
      6. Fill in appropriate values into command and run:

      mvn clean verify -U -Dmaven.test.failure.ignore=true -Ddatabase=oracle12cRAC -Ddriver.dir={DRIVER_DIRECTORY} -Ddriver.jar=ojdbc8.jar -Ddriver.class=oracle.jdbc.OracleDriver -Dconnection.url={CONNECTION_URL_FROM_DB_ALLOCATOR_1(do not forget to remove "\")} -Ddb.username={DB_USERNAME_1} -Ddb.password={DB_PASSWORD_1} -Dfile.log.level=INFO  -Dnode0={PATH_TO_JDG_SERVER_1} -Dnode1={PATH_TO_JDG_SERVER_2} -Dstack=udp -Dconnection.url={CONNECTION_URL_FROM_DB_ALLOCATOR_2(do not forget to remove "\")} -Ddb.username={DB_USERNAME_2} -Ddb.password={DB_PASSWORD_2}
      
      Show
      1. Clone https://github.com/infinispan/jdg-functional-tests (branch master) 2. Allocate TWO DBs using this link: http://dballocator.mw.lab.eng.bos.redhat.com:8080/Allocator/AllocatorServlet?operation=allocate&expression=oracle12cRAC%26%26geo_BOS&expiry=1440&requestee=GUI (keep open for later reference) 3. Download driver from http://www.qa.jboss.com/jdbc-drivers-products/EAP/7.1.0/oracle12cRAC/jdbc4/ojdbc8.jar 4. Prepare two folders with a copy of JDG server of appropriate version in them 5. Go to jdg-functional-tests/remote/jdbc-cache-store/ 6. Fill in appropriate values into command and run: mvn clean verify -U -Dmaven.test.failure.ignore= true -Ddatabase=oracle12cRAC -Ddriver.dir={DRIVER_DIRECTORY} -Ddriver.jar=ojdbc8.jar -Ddriver.class=oracle.jdbc.OracleDriver -Dconnection.url={CONNECTION_URL_FROM_DB_ALLOCATOR_1( do not forget to remove "\" )} -Ddb.username={DB_USERNAME_1} -Ddb.password={DB_PASSWORD_1} -Dfile.log.level=INFO -Dnode0={PATH_TO_JDG_SERVER_1} -Dnode1={PATH_TO_JDG_SERVER_2} -Dstack=udp -Dconnection.url={CONNECTION_URL_FROM_DB_ALLOCATOR_2( do not forget to remove "\" )} -Ddb.username={DB_USERNAME_2} -Ddb.password={DB_PASSWORD_2}

      JDBC CacheStore Passivating data into Oracle 12c RAC DB will fail with following error (Full stacktrace in attachment):

      [java] Caused by: Error : 928, Position : 47, Sql = MERGE INTO "EDG_STRING2_memcachedCache" USING (VALUES (:1 , :2 , :3 )) AS tmp (datum, version, id) ON (datum = tmp.datum) WHEN MATCHED THEN UPDATE SET version = tmp.version, id = tmp.id WHEN NOT MATCHED THEN INSERT (datum, version, id) VALUES (tmp.datum, tmp.version, tmp.id), OriginalSql = MERGE INTO "EDG_STRING2_memcachedCache" USING (VALUES (?, ?, ?)) AS tmp (datum, version, id) ON (datum = tmp.datum) WHEN MATCHED THEN UPDATE SET version = tmp.version, id = tmp.id WHEN NOT MATCHED THEN INSERT (datum, version, id) VALUES (tmp.datum, tmp.version, tmp.id), Error Msg = ORA-00928: missing SELECT keyword
      [java] at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
      [java] ... 107 more

      As far as I know, merging tables in oracle BD requires two actual database objects, so I believe substituting

      (SELECT :1 datum, :2 version, :3 id FROM dual) tmp

      for

      (VALUES (:1 , :2 , :3 )) AS tmp

      should do the trick.

      Note: The target object in the query (EDG_STRING2_memcachedCache table in this case) could also use a naming ("target"?) to avoid possible ambiguity. Some DBs are touchy about that.

            zhostasa_jira Zdenek Hostasa (Inactive)
            zhostasa_jira Zdenek Hostasa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: