Search code examples
cachingconfigurationconfigignitetibco-business-works

How to set a query timeout for apache ignite cache?


I am working on TIBCO BusinessWorks 5.3. So we normally provide query timeout in the SQL Direct/JDBC Query activity. But for Ignite cache that timeout does no seem to work.

This is installed on a Linux server. I tried to add the setTimeout property in the config xml under cacheConfiguration property node.

I have tried with 2 different configurations

1.

<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="cacheConfiguration">
 <list>
   <bean class="org.apache.ignite.configuration.CacheConfiguration">
     <!--some properties-->
     <property name="setTimeout" value="60" />
   </bean>                      
</list>
</property> 

2.

<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="cacheConfiguration">
 <list>
   <bean class="org.apache.ignite.configuration.CacheConfiguration">
     <!--some properties-->
   </bean>
  <bean class="org.apache.ignite.cache.query.SqlFieldsQuery"> 
    <property name="setTimeout" value="60" />
  </bean>                       
</list>
</property>

Error message is thrown as below-

    org.springframework.beans.NotWritablePropertyException: Invalid 
    property setTimeout of bean class 
    [org.apache.ignite.configuration.CacheConfiguration]: Bean property 
    setTimeout is not writable or has an invalid setter method.

Solution

  • Currently you may use SqlQuery/SqlFieldsQuery API to set individual timeouts for queries: https://apacheignite-sql.readme.io/docs/query-cancellation

    It's a known issue that there is no option to configure default timeout for a query, here is link for your reference (there is a PR that was active month ago): https://issues.apache.org/jira/browse/IGNITE-7285

    JDBC query timeout is implemented, but not yet documented/released: https://issues.apache.org/jira/browse/IGNITE-5438