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

SQLServerException in JDBC Store when purgeExpired is called

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • RHDG 8.5.1 GA
    • None
    • None
    • None

      When using infinispan-cachestore-jdbc with a MSSQL Database a SQLServerException is raised when the purgeExpired method is called after the startup.

      When using MSSQL the class 
      org.infinispan.persistence.jdbc.impl.table.TableOperations is used as TableManager. In that class the method initSelectOnlyExpiredRowsSql is overridden and uses  getLoadAllRowsSql for the select part of the query. getLoadAllRowsSql selects data and id columns, but not the timestamp column. So there is no index 3.
       

      2024-07-12 06:59:36,809 ERROR [org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore] (blocking-thread--p3-t2) ISPN008001: Failed clearing cache store: com.microsoft.sqlserver.jdbc.SQLServerException: The index 3 is out of range.
           at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:233)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.verifyValidColumnIndex(SQLServerResultSet.java:625)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getterGetColumn(SQLServerResultSet.java:2076)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2105)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2091)
           at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getLong(SQLServerResultSet.java:2401)
           at io.agroal.pool.wrapper.ResultSetWrapper.getLong(ResultSetWrapper.java:160)
           at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.lambda$purgeExpired$1(JdbcStringBasedStore.java:337)
           at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
           at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
           at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
           at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
           at java.base/java.lang.Thread.run(Thread.java:840)
       

              remerson@redhat.com Ryan Emerson
              rhel.henning@re-gister.com Peter Parker (Inactive)
              Anna Manukyan Anna Manukyan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: