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

REMOTE JDBC CacheStore failing upsert on MSSql 2012

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JDG 7.2 ER3
    • JDG 7.2 ER1
    • Server
    • None
    • ER3
    • Hide

      1. Clone https://github.com/infinispan/jdg-functional-tests (branch master)
      2. Allocate TWO DBs using this link: http://dballocator.mw.lab.eng.bos.redhat.com:8080/Allocator/AllocatorServlet?operation=allocate&expression=mssql2012%26%26geo_BOS&expiry=1440&requestee=GUI (keep open for later reference)
      3. Download driver from http://www.qa.jboss.com/jdbc-drivers-products/EAP/7.1.0/mssql2012/jdbc4/sqljdbc42.jar
      4. Prepare two folders with a copy of JDG server of appropriate version in them
      5. Go to jdg-functional-tests/remote/jdbc-cache-store/
      6. Fill in appropriate values into command and run:

      mvn clean verify -U -Dmaven.test.failure.ignore=true -Ddatabase=mssql2012 -Ddriver.dir={DRIVER_DIRECTORY} -Ddriver.jar=sqljdbc42.jar -Ddriver.class=com.microsoft.sqlserver.jdbc.SQLServerDriver -Dconnection.url='{CONNECTION_URL_FROM_DB_ALLOCATOR_1(do not forget to remove "\")}' -Ddb.username={DB_USERNAME_1} -Ddb.password={DB_PASSWORD_1} -Dfile.log.level=INFO  -Dnode0={PATH_TO_JDG_SERVER_1} -Dnode1={PATH_TO_JDG_SERVER_2} -Dstack=udp -Dconnection.url='{CONNECTION_URL_FROM_DB_ALLOCATOR_2(do not forget to remove "\")}' -Ddb.username={DB_USERNAME_2} -Ddb.password={DB_PASSWORD_2}
      
      

      Note: Unlike other commands in DB compatibility Jiras, this one REQUIRES those ' - signs at the URL values

      Show
      1. Clone https://github.com/infinispan/jdg-functional-tests (branch master) 2. Allocate TWO DBs using this link: http://dballocator.mw.lab.eng.bos.redhat.com:8080/Allocator/AllocatorServlet?operation=allocate&expression=mssql2012%26%26geo_BOS&expiry=1440&requestee=GUI (keep open for later reference) 3. Download driver from http://www.qa.jboss.com/jdbc-drivers-products/EAP/7.1.0/mssql2012/jdbc4/sqljdbc42.jar 4. Prepare two folders with a copy of JDG server of appropriate version in them 5. Go to jdg-functional-tests/remote/jdbc-cache-store/ 6. Fill in appropriate values into command and run: mvn clean verify -U -Dmaven.test.failure.ignore= true -Ddatabase=mssql2012 -Ddriver.dir={DRIVER_DIRECTORY} -Ddriver.jar=sqljdbc42.jar -Ddriver.class=com.microsoft.sqlserver.jdbc.SQLServerDriver -Dconnection.url= '{CONNECTION_URL_FROM_DB_ALLOCATOR_1( do not forget to remove "\" )}' -Ddb.username={DB_USERNAME_1} -Ddb.password={DB_PASSWORD_1} -Dfile.log.level=INFO -Dnode0={PATH_TO_JDG_SERVER_1} -Dnode1={PATH_TO_JDG_SERVER_2} -Dstack=udp -Dconnection.url= '{CONNECTION_URL_FROM_DB_ALLOCATOR_2( do not forget to remove "\" )}' -Ddb.username={DB_USERNAME_2} -Ddb.password={DB_PASSWORD_2} Note: Unlike other commands in DB compatibility Jiras, this one REQUIRES those ' - signs at the URL values

      JDBC CacheStore Passivating data into MSSql 2012 DB will fail with following error (Full stacktrace in attachment):

      ISPN008024: Error while storing string key to database; key: 'key': com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK_EDG_INVA_3213E83F43843313'. Cannot insert duplicate key in object 'dbo.EDG_INVAL_memcachedCache'. The duplicate key value is (key).
      ...
      ISPN000136: Error executing command PutKeyValueCommand, writing keys [key]: org.infinispan.persistence.spi.PersistenceException: Error while storing string key to database; key: 'key'
      at org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore.write(JdbcStringBasedStore.java:128)
      ...
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK_EDG_INVA_3213E83F43843313'. Cannot insert duplicate key in object 'dbo.EDG_INVAL_memcachedCache'. The duplicate key value is (key).
      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)

              remerson@redhat.com Ryan Emerson
              zhostasa_jira Zdenek Hostasa (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: