Hi Pavel,
Below is the link to download the solution. The attached solution has 4
projects. TestIgniteServer is used to start Ignite node in server mode.
TestIgniteSQLClient is used to start Ignite in client mode and execute the
sql query against the cache.
https://drive.google.com/open?id=0B8lM91-_3MwRYUxqX2ZHU0thRmc
Thanks again for your help,
Satya.
On Sun, Apr 10, 2016 at 2:33 AM, Pavel Tupitsyn <[email protected]>
wrote:
> Satya, there is some issue with configuration in your code. Looks like you
> use different XML than provided above. Make sure the path is correct.
> Or, you can attach your entire solution, and I'll take a look.
>
> Pavel.
>
> On Sat, Apr 9, 2016 at 7:29 PM, Murthy Kakarlamudi <[email protected]>
> wrote:
>
>> Hi Pavel,
>> Is that the only change needed? I added that property and I am still
>> getting the same error.
>>
>> <property name="cacheConfiguration">
>> <list>
>> <bean class="org.apache.ignite.configuration.CacheConfiguration">
>> *<property name="name" value="BU"/>*
>> <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>
>>
>> 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
>> StackTrace:
>> at
>> Apache.Ignite.Core.Impl.Unmanaged.UnmanagedCallbacks.Error(Void* target,
>> Int32 errType, SByte* errClsChars, Int32 errClsCharsLen, SByte*
>> errMsgChars, Int32 errMsgCharsLen, Void* errData, Int32 errDataLen)
>> at
>> Apache.Ignite.Core.Impl.Unmanaged.IgniteJniNativeMethods.CacheOutOpQueryCursor(Void*
>> ctx, Void* obj, Int32 type, Int64 memPtr)
>> at
>> Apache.Ignite.Core.Impl.Unmanaged.UnmanagedUtils.CacheOutOpQueryCursor(IUnmanagedTarget
>> target, Int32 type, Int64 memPtr)
>> at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.Query(QueryBase qry)
>> at TestIgniteSQLClient.IgniteSQLClient.Main(String[] args) in
>> C:\Data\Professional\dotnet\workspace\TestIgnite\TestIgniteSQLClient\IgniteSQLClient.cs:line
>> 34
>> InnerException:
>>
>>
>> On Sat, Apr 9, 2016 at 11:32 AM, Pavel Tupitsyn <[email protected]>
>> wrote:
>>
>>> Hi Satya,
>>>
>>> > Indexing is disabled for cache: BU.
>>> In the XML configuration, please set cache name like this:
>>>
>>> ...
>>> <bean class="org.apache.ignite.configuration.CacheConfiguration">
>>> <property name="name" value="BU"/>
>>> ...
>>>
>>>
>>> > 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
>>> Yes, in 1.5, using Spring XML and Java types is the only way.
>>> This is already fixed, and in upcoming Ignite 1.6 everything can be
>>> configured right from C#.
>>>
>>> Thanks,
>>> Pavel.
>>>
>>> On Sat, Apr 9, 2016 at 5:10 PM, Murthy Kakarlamudi <[email protected]>
>>> wrote:
>>>
>>>> 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.
>>>>
>>>
>>>
>>
>