Hi,
In my .NET application, I have an underlying SQL Server DB that I am
planning to access using Ignite Persistence feature. I was following the
StoreExample provided in the examples and created the ignite configuration
accordingly.
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="writeThrough" value="true"/>
<property name="readThrough" value="true"/>
<property name="cacheStoreFactory">
<bean
class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
<property name="typeName" value="MyIgnite.SQLServerStore,
MyIgnite"/>
</bean>
</property>
</bean>
</list>
</property>
My SQLServerStore which is part of MyIgnite dll is as below. I am using
EntityFramework as ORM to access underlying SQLServer.
class SQLServerStore : CacheStoreAdapter
{
private TestEntities entities;
public SQLServerStore()
{
entities = new TestEntities();
}
/// <summary>
/// Loads all values from underlying persistent storage.
/// This method gets called as a result of <see
cref="ICache{TK,TV}.LoadCache"/> call.
/// </summary>
/// <param name="act">Action that loads a cache entry.</param>
/// <param name="args">Optional arguments.</param>
public override void LoadCache(Action<object, object> act, params
object[] args)
{
var personDetailsList = entities.PersonDetails;
// Iterate over whole underlying store and call act on each
entry to load it into the cache.
foreach (personDetail entry in personDetailsList)
{
act(entry.personD, entry);
}
}
}
Whwn I try to run the above, I am getting the below error.
Apache.Ignite.Core.Common.IgniteException was unhandled
HResult=-2146233088
Message=Exception has been thrown by the target of an invocation.
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.IgnitionStart(Void*
ctx, SByte* cfgPath, SByte* gridName, Int32 factoryId, Int64 dataPtr)
at
Apache.Ignite.Core.Impl.Unmanaged.UnmanagedUtils.IgnitionStart(UnmanagedContext
ctx, String cfgPath, String gridName, Boolean clientMode)
at Apache.Ignite.Core.Ignition.Start(IgniteConfiguration cfg)
at MyIgniteConsole.Program.Main(String[] args) in
C:\Data\Professional\dotnet\workspace\MyIgnite\MyIgniteConsole\Program.cs:line
21
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Any help would be appreciated.
Thanks,
Satya.