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

Clustering: com.microsoft.sqlserver.jdbc.SQLServerException in SQL Server tests

XMLWordPrintable

      The error was spotted in Clustering tests where session data is offloaded to a Microsoft SQL Server 2017; the server configuration is as follows:

      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()
      /subsystem=infinispan/cache-container=web/invalidation-cache==offload/component=transaction:write-attribute(name=mode, value=BATCH)
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/component=locking:write-attribute(name=isolation, value=REPEATABLE_READ)
      data-source add --name=testDS --jndi-name=java:jboss/datasources/testDS --driver-name=mssql-connector.jar --connection-url=jdbc:sqlserver://mssql-2017.hosts.prod.upshift.rdu2.redhat.com:1433;DatabaseName=dballo02 --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=dballo02 --password=dballo02 --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=SQL_SERVER){allow-resource-service-restart=true}
      /subsystem=infinispan/cache-container=web/invalidation-cache=offload/store=jdbc/table=string:write-attribute(name=prefix,value=s)
      /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=id-column.type,value=VARCHAR(255))
      /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=data-column.type,value=VARBINARY(8000))
      /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=timestamp-column.type,value=BIGINT)
      /subsystem=infinispan/cache-container=web:write-attribute(name=default-cache, value=offload)
      /subsystem=transactions:write-attribute(name=node-identifier,value=wildfly1)
      

      The error happens when a node leaves the cluster:

      2020-02-21 07:54:32,513 INFO  [org.infinispan.CLUSTER] (thread-13,ejb,wildfly2) ISPN000094: Received new cluster view for channel ejb: [wildfly2|4] (3) [wildfly2, wildfly3, wildfly4]
      2020-02-21 07:54:32,513 INFO  [org.infinispan.CLUSTER] (thread-13,ejb,wildfly2) ISPN100001: Node wildfly1 left the cluster
      2020-02-21 07:54:32,545 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p18-t22) [Context=cbnc.ear.b.war] ISPN100007: After merge (or coordinator change), recovered members [wildfly2, wildfly3, wildfly4] with topology id 8
      2020-02-21 07:54:32,556 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p18-t22) [Context=cbnc.ear.b.war] ISPN100008: Updating cache members list [wildfly2, wildfly3, wildfly4], topology id 9
      2020-02-21 07:54:32,557 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p18-t22) [Context=cbnc.ear.a.war] ISPN100007: After merge (or coordinator change), recovered members [wildfly2, wildfly3, wildfly4] with topology id 8
      2020-02-21 07:54:32,568 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p20-t69) [Context=cbnc.ear/clusterbench-ejb.jar/infinispan] ISPN100007: After merge (or coordinator change), recovered members [wildfly2, wildfly3, wildfly4] with topology id 19
      2020-02-21 07:54:32,571 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p20-t66) [Context=client-mappings] ISPN100007: After merge (or coordinator change), recovered members [wildfly2, wildfly3, wildfly4] with topology id 15
      2020-02-21 07:54:32,573 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p18-t22) [Context=cbnc.ear.a.war] ISPN100008: Updating cache members list [wildfly2, wildfly3, wildfly4], topology id 9
      2020-02-21 07:54:32,574 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p18-t22) [Context=cbnc.ear.c.war] ISPN100007: After merge (or coordinator change), recovered members [wildfly2, wildfly3, wildfly4] with topology id 8
      2020-02-21 07:54:32,575 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p18-t22) [Context=cbnc.ear.c.war] ISPN100008: Updating cache members list [wildfly2, wildfly3, wildfly4], topology id 9
      2020-02-21 07:54:32,566 INFO  [org.infinispan.CLUSTER] (stateTransferExecutor-thread--p18-t24) [Context=default-server] ISPN100007: After merge (or coordinator change), recovered members [wildfly2, wildfly3, wildfly4] with topology id 15
      2020-02-21 07:55:13,577 ERROR [org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore] (expiration-thread--p24-t1) ISPN008001: Failed clearing cache store: com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1624)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:594)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:524)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2979)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223)
      	at deployment.mssql-connector.jar//com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:446)
      	at org.jboss.ironjacamar.jdbcadapters@1.4.19.Final-redhat-00001//org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:113)
      	at org.jboss.ironjacamar.jdbcadapters@1.4.19.Final-redhat-00001//org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:504)
      	at org.infinispan.persistence.jdbc@9.4.16.Final-redhat-00002//org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.purge(JdbcStringBasedStore.java:456)
      	at org.infinispan@9.4.16.Final-redhat-00002//org.infinispan.persistence.manager.PersistenceManagerImpl.lambda$purgeExpired$6(PersistenceManagerImpl.java:470)
      	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
      	at org.infinispan@9.4.16.Final-redhat-00002//org.infinispan.persistence.manager.PersistenceManagerImpl.purgeExpired(PersistenceManagerImpl.java:473)
      	at org.infinispan@9.4.16.Final-redhat-00002//org.infinispan.expiration.impl.ExpirationManagerImpl.processExpiration(ExpirationManagerImpl.java:111)
      	at org.infinispan@9.4.16.Final-redhat-00002//org.infinispan.expiration.impl.ExpirationManagerImpl$ScheduledTask.run(ExpirationManagerImpl.java:245)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
      	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at org.wildfly.clustering.service@7.3.0.GA-redhat-00004//org.wildfly.clustering.service.concurrent.ClassLoaderThreadFactory.lambda$newThread$0(ClassLoaderThreadFactory.java:47)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      

      The client isn't affected by the error;
      Complete logs attached;

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

                Created:
                Updated:
                Resolved: