Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14521

JDBC Cache Store uses fetchSize Integer.MIN_VALUE for reading whole cache

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 14.0.6.Final
    • Loaders and Stores
    • None
    • Hide

      Use MariaDB JDBC Connector in Version 3.0.9 against MariaDB DB and the error should occur with configured JDBCCacheStore:

      java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: (conn=13) invalid fetch size

       

      Show
      Use MariaDB JDBC Connector in Version 3.0.9 against MariaDB DB and the error should occur with configured JDBCCacheStore: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: (conn=13) invalid fetch size  

      For MariaDB and MySQL the fetchSize Value is fixed with the value Integer.MIN_VALUE, see this line:

      https://github.com/infinispan/infinispan/blob/2b628e223b72937c17d2b82d2bdde43a9d90ca87/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/impl/table/MyTableOperations.java#L21

      In newer versions of MariaDB JDBC driver, e.g. 3.0.9 values with X< 0 for fetch size are not allowed. A exceptions happens when starting the store.  It seems that the value Integer.MIN_VALUE is related to some legacy JDBC drivers. See here:

      https://mariadb.com/kb/en/about-mariadb-connector-j/#streaming-result-sets

      Solution: Best would be to hold the fetchSize value flexible as the AbstractTableManager does:

      https://github.com/infinispan/infinispan/blob/2b628e223b72937c17d2b82d2bdde43a9d90ca87/persistence/jdbc/src/main/java/org/infinispan/persistence/jdbc/impl/table/AbstractTableManager.java#L357

      So everyone could configure his own fetch size for MariaDB and MySQL. The default could be Integer.MIN_VALUE for compatibility

              remerson@redhat.com Ryan Emerson
              thaefner Tobias Häfner (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: