Hi All,
I am running into below error trying to run SqlQuery in .NET.
Apache.Ignite.Core.Common.IgniteException was unhandled
HResult=-2146233088
Message=Indexing is disabled for cache: BU. Use setIndexedTypes or
setTypeMetadata methods on CacheConfiguration to enable.
Source=Apache.Ignite.Core
I am storing the entity created by Entity Framework in cache and trying to
query that POCO. Below are my Ignite config xml and the query I am using.
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="writeThrough" value="true"/>
<property name="readThrough" value="true"/>
<property name="writeBehindEnabled" value="true"/>
<property name="writeBehindFlushFrequency" value="120000"/>
<property name="cacheStoreFactory">
<bean
class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
<property name="typeName"
value="TestIgniteDAL.SQLServerStore, TestIgniteDAL"/>
</bean>
</property>
<property name ="typeMetadata">
<list>
<bean class="org.apache.ignite.cache.CacheTypeMetadata">
<!-- Type to query. -->
<property name="valueType"
value="TestIgniteDAL.BusinessUnit"/>
<!-- Fields to be queried. -->
<property name="queryFields">
<map>
<entry key="BUID" value="java.lang.Long"/>
<entry key="BUName" value="java.lang.String"/>
<entry key="CreatedByID" value="java.lang.Long"/>
<entry key="CreatedDate" value="java.util.Date"/>
<entry key="ModifiedByID" value="java.lang.Long"/>
<entry key="ModifiedDate" value="java.util.Date"/>
</map>
</property>
<!-- Fields to index in ascending order. -->
<property name="ascendingFields">
<map>
<entry key="BUID" value="java.lang.Long"/>
</map>
</property>
</bean>
</list>
</property>
</bean>
</list>
</property>
using (var ignite = Ignition.Start(cfg))
{
Console.WriteLine(">>> Cache query example started");
var cache = ignite.GetCache<int, BusinessUnit>("BU");
var qry = cache.Query(new
SqlQuery(typeof(BusinessUnit),"BUID=?",5));
foreach(var bu in qry)
{
Console.WriteLine(bu);
}
}
Also, do I have to specify the column type classes in java(ex
java.lang.Long etc) in the config xml even if I am working in .NET world.
Or can I use .NET equivalent classes from the POCO that was generated from
Entity Framework?
Thanks,
Satya.