Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-23751

Clustering Oracle JDBC store: "properties" and "prefix" not applied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Blocker Blocker
    • None
    • 8.0.0.Beta
    • Clustering
    • None
    • False
    • None
    • False

      Scenario: "prefix" not written to "standalone-ha.xml"

      The scenario is the following: we are using a 4 nodes cluster which persists data to an Oracle JDBC store;

      This is the complete configurations script:

      embed-server --server-config=standalone-ha.xml
      /subsystem=jgroups/channel=ee:write-attribute(name=stack,value=tcp)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload:add()
      data-source add --name=testDS --jndi-name=java:jboss/datasources/testDS --driver-name=oracle-connector.jar --connection-url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=oracle-19c-rac-01.mwqe.upshift.rdu2.redhat.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=oracle-19c-rac-02.mwqe.upshift.rdu2.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dballo))) --enabled=true --jta=true --use-java-context=true --transaction-isolation=TRANSACTION_READ_COMMITTED --min-pool-size=1 --max-pool-size=5 --pool-prefill=true --user-name=dballo03 --password=dballo03 --prepared-statements-cache-size=32 --share-prepared-statements=true
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc:add(data-source=testDS,fetch-state=false,passivation=false,purge=false,shared=true,dialect=ORACLE){allow-resource-service-restart=true}
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=id-column.name,value=id)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=data-column.name,value=datum)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=timestamp-column.name,value=version)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=id-column.type,value=VARCHAR2(255))
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=timestamp-column.type,value=NUMBER)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=data-column.type,value=BLOB)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=prefix, value=i){allow-resource-service-restart=true}
      /subsystem=infinispan/cache-container=web:write-attribute(name=default-cache, value=offload)
      

      Since we set:

      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=prefix, value=i)
      

      and since our deployment's name is "cbnc.ear", we expect table names like i_cbnc_etc..: instead we get "ispn_entry_cbnc_ear_";

      This has the side effect of failing index creation on the DB, since index names are limited to 30 characters length:

      could not deploy /tmp/tests-clustering/cbnc.ear via management client to service WildFly Service 1, result is not a success: 
      15:01:11 {
      15:01:11     "outcome" : "failed",
      15:01:11     "failure-description" : {"WFLYCTL0080: Failed services" : {
      15:01:11         "org.wildfly.clustering.infinispan.cache.web.\"cbnc.ear.b.war\"" : "org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager\n    Caused by: org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager\n    Caused by: java.util.concurrent.CompletionException: org.infinispan.persistence.spi.PersistenceException: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object\n\n    Caused by: org.infinispan.persistence.spi.PersistenceException: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object\n\n    Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object\n\n    Caused by: Error : 955, Position : 13, Sql = CREATE INDEX \"segment_index_ispn_entry_cbnc_\" ON \"ispn_entry_cbnc_ear_b_war\" (segment), OriginalSql = CREATE INDEX \"segment_index_ispn_entry_cbnc_\" ON \"ispn_entry_cbnc_ear_b_war\" (segment), Error Msg = ORA-00955: name is already used by an existing object\n",
      15:01:11         "org.wildfly.clustering.infinispan.cache.web.\"cbnc.ear.c.war\"" : "org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager\n    Caused by: org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager\n    Caused by: java.util.concurrent.CompletionException: org.infinispan.persistence.spi.PersistenceException: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object\n\n    Caused by: org.infinispan.persistence.spi.PersistenceException: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object\n\n    Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object\n\n    Caused by: Error : 955, Position : 13, Sql = CREATE INDEX \"segment_index_ispn_entry_cbnc_\" ON \"ispn_entry_cbnc_ear_c_war\" (segment), OriginalSql = CREATE INDEX \"segment_index_ispn_entry_cbnc_\" ON \"ispn_entry_cbnc_ear_c_war\" (segment), Error Msg = ORA-00955: name is already used by an existing object\n"
      15:01:11     }}
      

      Please note that we don't see the "prefix=i" setting being written to "standalone-ha.xml":

                   <cache-container name="web" default-cache="offload" marshaller="PROTOSTREAM" modules="org.wildfly.clustering.web.infinispan">
                      <transport lock-timeout="60000"/>
                      <invalidation-cache name="offload">
                          <jdbc-store data-source="testDS" dialect="ORACLE" fetch-state="false" passivation="false" purge="false" shared="true">
                              <table>
                                  <id-column name="id" type="VARCHAR2(255)"/>
                                  <data-column name="datum" type="BLOB"/>
                                  <timestamp-column name="version" type="NUMBER"/>
                              </table>
                          </jdbc-store>
                      </invalidation-cache>
                 ...
                  </cache-container>
      

      Workaround not working: "segmented" written to "standalone-ha.xml" but ignored

      When we try the following workaround:

      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc:map-put(name=properties, key=segmented, value=false)
      

      we still get the same error:

      Error : 955, Position : 13, Sql = CREATE INDEX \"segment_index_ispn_entry_cbnc_\" ON \"ispn_entry_cbnc_ear_a_war\" (segment), OriginalSql = CREATE INDEX \"segment_index_ispn_entry_cbnc_\" ON \"ispn_entry_cbnc_ear_a_war\" (segment), Error Msg = ORA-00955: name is already used by an existing object
      

      even though the "segmented" property is correctly written to "standalone-ha.xml":

                     <invalidation-cache name="offload">
                          <jdbc-store data-source="testDS" dialect="ORACLE" fetch-state="false" passivation="false" purge="false" shared="true">
                              <property name="segmented">false</property>
                              <table>
                                  <id-column name="id" type="VARCHAR2(255)"/>
                                  <data-column name="datum" type="BLOB"/>
                                  <timestamp-column name="version" type="NUMBER"/>
                              </table>
                          </jdbc-store>
                      </invalidation-cache>
      

              pferraro@redhat.com Paul Ferraro
              tborgato@redhat.com Tommaso Borgato
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: