Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 1.91 KB  |  hits: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. EsentFileNotFoundException.FileNotFound exception when initializing RavenDb-Embedded
  2. EmbeddableDocumentStore _documentStore = new EmbeddableDocumentStore()
  3.         {
  4.             DataDirectory = @"C:tempRavenDb"
  5.         };
  6.  
  7.         using (_documentStore.Initialize())
  8.         {
  9.  
  10.         }
  11.        
  12. Microsoft.Isam.Esent.Interop.EsentFileNotFoundException occurred
  13. Message=File not found
  14. Source=Esent.Interop
  15. StackTrace:
  16.     at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err) in C:WorkravendbSharedLibsSourcesmanagedesent-61618EsentInteropApi.cs:line 2736
  17. InnerException:
  18.        
  19. System.IO.FileNotFoundException occurred
  20. Message=segments.gen
  21. Source=Lucene.Net
  22. StackTrace:
  23.    at Lucene.Net.Store.RAMDirectory.OpenInput(String name) in z:Libslucene.netsrccoreStoreRAMDirectory.cs:line 301
  24. InnerException:
  25.        
  26. private void RefreshGrid()
  27.     {
  28.  
  29.         BackgroundWorker bw = new BackgroundWorker();
  30.         bw.DoWork += new DoWorkEventHandler(bw_DoWork);            
  31.         bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
  32.         if (bw.IsBusy != true)
  33.         {
  34.             bw.RunWorkerAsync(_domainType);
  35.         }
  36.  
  37.     }
  38.  
  39.     void bw_DoWork(object sender, DoWorkEventArgs e)
  40.     {
  41.         e.Result = EventStoreInstance.Instance.GetAggregateRoots((Type)e.Argument);
  42.  
  43.     }
  44.        
  45. //Called in class ctor:
  46.         _publisher = publisher;
  47.         _documentStore = new EmbeddableDocumentStore()
  48.         {
  49.             DataDirectory = _dataDir // is "C:tempRavenDb"
  50.         };
  51.  
  52.     public List<AggregateRootModel> GetAggregateRoots(Type AggregrateRootType)
  53.     {
  54.         using (_documentStore.Initialize())
  55.         {
  56.             using (var session = _documentStore.OpenSession())
  57.             {
  58.                 var aggregateRoots = session.Query<AggregateRootModel>()
  59.                     .Where(p => p.Type == AggregrateRootType.AssemblyQualifiedName).ToList();
  60.                 return aggregateRoots;
  61.             }
  62.         }
  63.     }