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

Infinispan ignores DatabaseType configuration

    XMLWordPrintable

Details

    Description

      When I configure DefaultCacheManager with following configuration

      Configurator.java
              ConfigurationBuilder bld = new ConfigurationBuilder();
              bld.clustering().cacheMode(CacheMode.LOCAL)
                  .loaders().passivation(passivation).preload(preload).shared(false)
                  .addLoader(JdbcMixedCacheStoreConfigurationBuilder.class).fetchPersistentState(false).purgeOnStartup(false)
                  .databaseType(DatabaseType.MYSQL)
                   .stringTable()
                      .dropOnExit(false)
                      .createOnStart(true)
                      .tableNamePrefix("ISPN6Alpha2_STRING")
                      .idColumnName("ID").idColumnType("VARCHAR(255)")
                      .dataColumnName("DATA").dataColumnType("VARBINARY(1000)")
                      .timestampColumnName("TIMESTAMP").timestampColumnType("BIGINT")
                   .binaryTable()
                      .dropOnExit(false)
                      .createOnStart(true)
                      .tableNamePrefix("ISPN6Alpha2_BINARY")
                      .idColumnName("ID").idColumnType("VARCHAR(255)")
                      .dataColumnName("DATA").dataColumnType("VARBINARY(1000)")
                      .timestampColumnName("TIMESTAMP").timestampColumnType("BIGINT")
                   .dataSource()
                      .jndiUrl("java:jboss/datasources/ExampleDS");
      

      And here is TableManipulation class with getDatabaseType() method

      TableManipulation.java
        private DatabaseType getDatabaseType() {
            databaseType = config.databaseType();
            System.out.println(">>>>>>> databaseType "+ databaseType);
            if (databaseType == null) {
               // need to guess from the database type!
               Connection connection = null;
      ...
      

      Got the following output when test is running
      !!!!! is printed from my client code
      >>>>> is printed from infinispan(TableManipulation.java)


      [java] 10:59:07,347 INFO [stdout] (pool-1-thread-1) !!!!!!! databasetype MYSQL
      [java] 10:59:07,500 INFO [org.infinispan.factories.GlobalComponentRegistry] (pool-1-thread-1) ISPN000128: Infinispan version: Infinispan 'Infinium' 6.0.0.Alpha2-redhat-1
      [java] 10:59:09,851 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:11,953 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:12,644 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:12,645 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:13,393 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-1-thread-1) ISPN000031: MBeans were successfully registered to the platform MBean server.
      [java] 10:59:24,780 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:24,954 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:25,260 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:29,679 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:29,680 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:29,843 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:29,844 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:30,002 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-1-thread-1) ISPN000031: MBeans were successfully registered to the platform MBean server.
      [java] 10:59:38,626 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:38,776 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:41,806 INFO [org.jboss.arquillian.testenricher.cdi.container.BeanManagerProducer] (pool-1-thread-1) BeanManager not found.
      [java] 10:59:41,813 INFO [stdout] (pool-1-thread-1) !!!!!!! databasetype MYSQL
      [java] 10:59:41,848 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:41,848 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:42,018 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:42,020 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:42,176 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-1-thread-1) ISPN000031: MBeans were successfully registered to the platform MBean server.
      [java] 10:59:52,364 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:52,515 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:52,667 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] 10:59:57,155 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null


      And other issue with postgresqlplus92 DB, infinispan cannt recognize it like DatabaseType.POSTGRES here is a link on our jenkins job https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/edg-60-jdbc-cache-stores-eap6/185/DATABASE=postgresplus92,jdk=java17_default,label=RHEL6_x86_64/#showFailuresLink


      [java] [[0m[[0m10:53:45,198 INFO [stdout] (pool-1-thread-1) !!!!!!! databasetype POSTGRES
      [java] [[0m[[0m10:53:45,348 INFO [org.infinispan.factories.GlobalComponentRegistry] (pool-1-thread-1) ISPN000128: Infinispan version: Infinispan 'Infinium' 6.0.0.Alpha2-redhat-1
      [java] [[0m[[0m10:53:46,845 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:53:48,939 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:53:50,429 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:53:51,456 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:53:52,994 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-1-thread-1) ISPN000031: MBeans were successfully registered to the platform MBean server.
      [java] [[0m[[0m10:53:59,232 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:53:59,414 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:01,807 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:04,020 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:06,084 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:07,275 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:08,303 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:09,509 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-1-thread-1) ISPN000031: MBeans were successfully registered to the platform MBean server.
      [java] [[0m[[0m10:54:13,520 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:13,693 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:16,104 INFO [org.jboss.arquillian.testenricher.cdi.container.BeanManagerProducer] (pool-1-thread-1) BeanManager not found.
      [java] [[0m[[0m10:54:16,111 INFO [stdout] (pool-1-thread-1) !!!!!!! databasetype POSTGRES
      [java] [[0m[[0m10:54:16,148 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:18,180 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:19,352 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:20,358 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:21,531 INFO [org.infinispan.jmx.CacheJmxRegistration] (pool-1-thread-1) ISPN000031: MBeans were successfully registered to the platform MBean server.
      [java] [[0m[[0m10:54:26,078 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:26,256 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[0m10:54:27,419 INFO [stdout] (pool-1-thread-1) >>>>>>> databaseType null
      [java] [[0m[[31m10:54:57,421 ERROR [org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory] (pool-1-thread-1) ISPN008018: Sql failure retrieving connection from datasource: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:jboss/datasources/ExampleDS
      [java] at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:147)
      [java] at org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory.getConnection(ManagedConnectionFactory.java:82) [infinispan-cachestore-jdbc.jar:6.0.0.Alpha2-redhat-1]
      [java] at org.infinispan.loaders.jdbc.TableManipulation.getDatabaseType(TableManipulation.java:396) [infinispan-cachestore-jdbc.jar:6.0.0.Alpha2-redhat-1]
      [java] at org.infinispan.loaders.jdbc.TableManipulation.getSelectRowSql(TableManipulation.java:193) [infinispan-cachestore-jdbc.jar:6.0.0.Alpha2-redhat-1]
      [java] at org.infinispan.loaders.jdbc.binary.JdbcBinaryCacheStore.loadBucket(JdbcBinaryCacheStore.java:247) [infinispan-cachestore-jdbc.jar:6.0.0.Alpha2-redhat-1]


      Attachments

        Activity

          People

            mircea.markus Mircea Markus (Inactive)
            vchepeli_jira Vitalii Chepeliuk (Inactive)
            Vitalii Chepeliuk Vitalii Chepeliuk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: