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

Clustering Sybase JDBC store: "upsert" not applied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 8.0.0.Beta
    • Clustering
    • False
    • None
    • False

      Scenario

      The scenario is the following: we are using a 4 nodes cluster which persists data to a Sybase 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=sybase-connector.jar --connection-url=jdbc:sybase:Tds:sybase-160.hosts.mwqe.eng.bos.redhat.com:5000/dballo03 --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=SYBASE){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=VARCHAR(255))
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=timestamp-column.type,value=BIGINT)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=data-column.type,value=IMAGE)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc:map-put(name=properties,key=infinispan.jdbc.upsert.disabled,value=true){allow-resource-service-restart=true}
      /subsystem=infinispan/cache-container=web:write-attribute(name=default-cache, value=offload)
      

      The relevant setting for this issue is:

      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc:map-put(name=properties,key=infinispan.jdbc.upsert.disabled,value=true){allow-resource-service-restart=true}
      

      which is correctly 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="SYBASE" fetch-state="false" passivation="false" purge="false" shared="true">
                              <property name="infinispan.jdbc.upsert.disabled">true</property>
                              <table>
                                  <id-column name="id" type="VARCHAR(255)"/>
                                  <data-column name="datum" type="IMAGE"/>
                                  <timestamp-column name="version" type="BIGINT"/>
                              </table>
                          </jdbc-store>
                      </invalidation-cache>
                      ...
                  </cache-container>
      

      Nevertheless, we observe the following error which compromises cache operation:

      2022-06-21 13:07:02,128 WARN  [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (blocking-thread--p12-t3) IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@790b1852[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@53b1e101 connection handles=1 lastReturned=1655816821993 lastValidated=1655816504530 lastCheckedOut=1655816822009 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@58c3320e mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@2fe5faca[pool=testDS] xaResource=LocalXAResourceImpl@22a94aa0[connectionListener=790b1852 connectionManager=7ecc1e1d warned=false currentXid=null productName=Adaptive Server Enterprise productVersion=16.0.02.05 jndiName=java:jboss/datasources/testDS] txSync=null]: java.lang.ClassCastException: class java.io.ByteArrayInputStream cannot be cast to class com.sybase.jdbc4.jdbc.SybLob (java.io.ByteArrayInputStream is in module java.base of loader 'bootstrap'; com.sybase.jdbc4.jdbc.SybLob is in unnamed module of loader 'deployment.sybase-connector.jar' @1db1c25b)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.tds.TdsParam.prepareForSend(TdsParam.java:229)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.ParamManager.checkParams(ParamManager.java:1179)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.tds.Tds.sendDynamicExecuteParams(Tds.java:1499)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.tds.Tds.dynamicExecute(Tds.java:1403)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybPreparedStatement.sendQuery(SybPreparedStatement.java:2887)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybStatement.sendBatch(SybStatement.java:1922)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybStatement.executeBatch(SybStatement.java:1881)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybStatement.executeBatch(SybStatement.java:1799)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybPreparedStatement.executeBatch(SybPreparedStatement.java:1831)
      	at org.jboss.ironjacamar.jdbcadapters@1.5.6.Final//org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:714)
      	at org.jboss.ironjacamar.jdbcadapters@1.5.6.Final//org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1180)
      	at org.infinispan.persistence.jdbc@13.0.10.Final-redhat-00001//org.infinispan.persistence.jdbc.common.sql.BaseTableOperations.batchUpdates(BaseTableOperations.java:204)
      	at org.infinispan.persistence.jdbc@13.0.10.Final-redhat-00001//org.infinispan.persistence.jdbc.common.impl.BaseJdbcStore.lambda$batch$7(BaseJdbcStore.java:194)
      	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at org.wildfly.clustering.context@8.0.0.Beta-redhat-20220617//org.wildfly.clustering.context.ContextReferenceExecutor.execute(ContextReferenceExecutor.java:49)
      	at org.wildfly.clustering.context@8.0.0.Beta-redhat-20220617//org.wildfly.clustering.context.ContextualExecutor$1.run(ContextualExecutor.java:78)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      
      2022-06-21 13:07:02,131 INFO  [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (blocking-thread--p12-t3) IJ000302: Unregistered handle that was not registered: org.jboss.jca.adapters.jdbc.jdk8.WrappedConnectionJDK8@7efaf519 for managed connection: org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@53b1e101
      2022-06-21 13:07:03,160 ERROR [org.infinispan.interceptors.impl.InvocationContextInterceptor] (non-blocking-thread--p11-t3) ISPN000136: Error executing command PutMapCommand on Cache 'cbnc.ear.a.war', writing keys [SessionAccessMetaDataKey(CP6DZdtSaER6zbmEo3Li1DGaKYyS4cV0zXnoscI4), SessionCreationMetaDataKey(CP6DZdtSaER6zbmEo3Li1DGaKYyS4cV0zXnoscI4)]: org.infinispan.persistence.spi.PersistenceException: ISPN008037: Error while writing entries in batch to the database:
      	at org.infinispan.persistence.jdbc@13.0.10.Final-redhat-00001//org.infinispan.persistence.jdbc.common.impl.BaseJdbcStore.lambda$batch$7(BaseJdbcStore.java:197)
      	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at org.wildfly.clustering.context@8.0.0.Beta-redhat-20220617//org.wildfly.clustering.context.ContextReferenceExecutor.execute(ContextReferenceExecutor.java:49)
      	at org.wildfly.clustering.context@8.0.0.Beta-redhat-20220617//org.wildfly.clustering.context.ContextualExecutor$1.run(ContextualExecutor.java:78)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.sql.SQLException: Error
      	at org.jboss.ironjacamar.jdbcadapters@1.5.6.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:2046)
      	at org.jboss.ironjacamar.jdbcadapters@1.5.6.Final//org.jboss.jca.adapters.jdbc.WrappedStatement.checkException(WrappedStatement.java:1436)
      	at org.jboss.ironjacamar.jdbcadapters@1.5.6.Final//org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1184)
      	at org.infinispan.persistence.jdbc@13.0.10.Final-redhat-00001//org.infinispan.persistence.jdbc.common.sql.BaseTableOperations.batchUpdates(BaseTableOperations.java:204)
      	at org.infinispan.persistence.jdbc@13.0.10.Final-redhat-00001//org.infinispan.persistence.jdbc.common.impl.BaseJdbcStore.lambda$batch$7(BaseJdbcStore.java:194)
      	... 8 more
      Caused by: java.lang.ClassCastException: class java.io.ByteArrayInputStream cannot be cast to class com.sybase.jdbc4.jdbc.SybLob (java.io.ByteArrayInputStream is in module java.base of loader 'bootstrap'; com.sybase.jdbc4.jdbc.SybLob is in unnamed module of loader 'deployment.sybase-connector.jar' @1db1c25b)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.tds.TdsParam.prepareForSend(TdsParam.java:229)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.ParamManager.checkParams(ParamManager.java:1179)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.tds.Tds.sendDynamicExecuteParams(Tds.java:1499)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.tds.Tds.dynamicExecute(Tds.java:1403)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybPreparedStatement.sendQuery(SybPreparedStatement.java:2887)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybStatement.sendBatch(SybStatement.java:1922)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybStatement.executeBatch(SybStatement.java:1881)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybStatement.executeBatch(SybStatement.java:1799)
      	at deployment.sybase-connector.jar//com.sybase.jdbc4.jdbc.SybPreparedStatement.executeBatch(SybPreparedStatement.java:1831)
      	at org.jboss.ironjacamar.jdbcadapters@1.5.6.Final//org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:714)
      	at org.jboss.ironjacamar.jdbcadapters@1.5.6.Final//org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1180)
      	... 10 more
      

      That setting was considered a workaround itself for https://issues.redhat.com/browse/JBEAP-18349: hence we don't have a workaround at present for the issue.

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

              Created:
              Updated: