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

SQL Store fail to persist numbers with fractional portion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 14.0.0.Final
    • 13.0.10.Final
    • Persistence
    • None

    Description

      If a protobuf entry contains a number with fractional portion it fails to persist this value for MicrosoftSQL 2019 server or Postgresql 13.

       
      SQL column type = [numeric](18, 2).
      Configuration of table in postgres:
         create table test(name varchar(30) PRIMARY KEY, value decimal(10,4));
       
       JSON = "vlNum": 1.23,
       
      Using the infinispan CLI and making a put, or making a put in the web console
       
        PROTOBUF = optional double vlNum = 14;
       
      try with double and with float values too.
       

      All time when the server will persist data in DB and this WARN appears:
       
       
      WARN  (non-blocking-thread-maquina1-node1-p2-t2) [org.infinispan.CONTAINER] ISPN000028: Unable to passivate entry under WrappedByteArray[\J04\e\r\o\m (6 bytes)] java.util.concurrent.CompletionException: java.lang.NumberFormatException: For input string: "34.3434"
      at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
      at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
      at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.NumberFormatException: For input string: "34.3434"
      at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.base/java.lang.Integer.parseInt(Integer.java:652)
      at java.base/java.lang.Integer.parseInt(Integer.java:770)
      at org.infinispan.commons.dataconversion.internal.Json$StringJson.asInteger(Json.java:2204)
      at org.infinispan.persistence.sql.AbstractSchemaJdbcStore$SchemaTableOperations.setParameter(AbstractSchemaJdbcStore.java:471)
      at org.infinispan.persistence.sql.AbstractSchemaJdbcStore$SchemaTableOperations.prepareValueStatement(AbstractSchemaJdbcStore.java:604)
      at org.infinispan.persistence.jdbc.common.sql.BaseTableOperations.upsertEntry(BaseTableOperations.java:141)
      at org.infinispan.persistence.jdbc.common.impl.BaseJdbcStore.lambda$write$4(BaseJdbcStore.java:144)
      at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
      ... 5 more
      2022-09-12 08:55:42,877 WARN  (non-blocking-thread-maquina1-node2-p2-t3) [org.infinispan.CONTAINER] ISPN000028: Unable to passivate entry under WrappedByteArray[\J04\e\r\o\m (6 bytes)] java.util.concurrent.CompletionException: java.lang.NumberFormatException: For input string: "34.3434"
      at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
      at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
      at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.NumberFormatException: For input string: "34.3434"
      at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.base/java.lang.Integer.parseInt(Integer.java:652)
      at java.base/java.lang.Integer.parseInt(Integer.java:770)
      at org.infinispan.commons.dataconversion.internal.Json$StringJson.asInteger(Json.java:2204)
      at org.infinispan.persistence.sql.AbstractSchemaJdbcStore$SchemaTableOperations.setParameter(AbstractSchemaJdbcStore.java:471)
      at org.infinispan.persistence.sql.AbstractSchemaJdbcStore$SchemaTableOperations.prepareValueStatement(AbstractSchemaJdbcStore.java:604)
      at org.infinispan.persistence.jdbc.common.sql.BaseTableOperations.upsertEntry(BaseTableOperations.java:141)
      at org.infinispan.persistence.jdbc.common.impl.BaseJdbcStore.lambda$write$4(BaseJdbcStore.java:144)
      at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
      ... 5 more

      Attachments

        Issue Links

          Activity

            People

              wburns@redhat.com Will Burns
              rhn-support-wfink Wolf Fink
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: