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

Execute transactional delete from query statement as clustered query

XMLWordPrintable

      It seems that if we have a transactional clustered-replicated cache and we try to execute the statement:

      org.infinispan.query.dsl.Query<Object> dslQuery = queryFactory.create("delete from com.database.entities.MyTable qq where qq." + dbField + " = '" + this.GetLastInsertId() + "'");
      dslQuery.local(false);
      int qs = dslQuery.executeStatement();
      

      with the following configuration:

      <replicated-cache name="custom_cache" mode="SYNC" remote-timeout="600000" statistics="true">
          <locking striping="false" acquire-timeout="120000" concurrency-level="500" isolation="REPEATABLE_READ" />
      
          <transaction locking="PESSIMISTIC" auto-commit="false" mode="FULL_XA" notifications="false" transaction-manager-lookup="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"/>
          <indexing index="ALL" storage="filesystem">
      
              <indexed-entities>
                  <indexed-entity>some.indexed.Entity</indexed-entity>
              </indexed-entities>
              
              <property name="default.indexBase">/some/directory/indexes</property>
              <property name="default.indexmanager">near-real-time</property>
          </indexing>
          <expiration max-idle="-1" />
          
          <state-transfer enabled="true" timeout="600000" await-initial-transfer="true" />
          <persistence  passivation="false">
              <file-store shared="false" preload="false" fetch-state="true" read-only="false" purge="false" path="/some/directory/store">
                  <write-behind modification-queue-size="5" fail-silently="false"/>
              </file-store>
          </persistence>
      </replicated-cache> 
      

      we get the error:

      org.hibernate.search.util.common.SearchException: Exception while searching locally
      at org.infinispan.query.clustered.ClusteredQueryInvoker.broadcast(ClusteredQueryInvoker.java:89)
      at org.infinispan.query.clustered.DistributedIndexedQueryImpl.executeStatement(DistributedIndexedQueryImpl.java:156)
      at org.infinispan.query.dsl.embedded.impl.EmbeddedLuceneQuery.executeStatement(EmbeddedLuceneQuery.java:90)
      at org.infinispan.query.core.impl.DelegatingQuery.executeStatement(DelegatingQuery.java:111)
      
      Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Cannot create a transactional context without a valid Transaction instance.
      at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
      at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
      at org.infinispan.util.concurrent.CompletableFutures.await(CompletableFutures.java:126)
      at org.infinispan.query.clustered.ClusteredQueryInvoker.broadcast(ClusteredQueryInvoker.java:74)
      ... 4 more
      

              pruivo@redhat.com Pedro Ruivo
              fercoli@redhat.com Fabio Massimo Ercoli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: