ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murthy Kakarlamudi <ksa...@gmail.com>
Subject Re: .NET SQLQuery Error
Date Sat, 09 Apr 2016 16:29:45 GMT
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 <ptupitsyn@gridgain.com>
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 <ksatya@gmail.com>
> 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.
>>
>
>

Mime
View raw message