
Untitled
By: a guest on
May 6th, 2012 | syntax:
None | size: 1.91 KB | hits: 38 | expires: Never
EsentFileNotFoundException.FileNotFound exception when initializing RavenDb-Embedded
EmbeddableDocumentStore _documentStore = new EmbeddableDocumentStore()
{
DataDirectory = @"C:tempRavenDb"
};
using (_documentStore.Initialize())
{
}
Microsoft.Isam.Esent.Interop.EsentFileNotFoundException occurred
Message=File not found
Source=Esent.Interop
StackTrace:
at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err) in C:WorkravendbSharedLibsSourcesmanagedesent-61618EsentInteropApi.cs:line 2736
InnerException:
System.IO.FileNotFoundException occurred
Message=segments.gen
Source=Lucene.Net
StackTrace:
at Lucene.Net.Store.RAMDirectory.OpenInput(String name) in z:Libslucene.netsrccoreStoreRAMDirectory.cs:line 301
InnerException:
private void RefreshGrid()
{
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
if (bw.IsBusy != true)
{
bw.RunWorkerAsync(_domainType);
}
}
void bw_DoWork(object sender, DoWorkEventArgs e)
{
e.Result = EventStoreInstance.Instance.GetAggregateRoots((Type)e.Argument);
}
//Called in class ctor:
_publisher = publisher;
_documentStore = new EmbeddableDocumentStore()
{
DataDirectory = _dataDir // is "C:tempRavenDb"
};
public List<AggregateRootModel> GetAggregateRoots(Type AggregrateRootType)
{
using (_documentStore.Initialize())
{
using (var session = _documentStore.OpenSession())
{
var aggregateRoots = session.Query<AggregateRootModel>()
.Where(p => p.Type == AggregrateRootType.AssemblyQualifiedName).ToList();
return aggregateRoots;
}
}
}