0

We are trying to use Esent database as a replacement to a huge in-memory list to free up memory while the execution of application. But as there are a lot of instances of ESENTDbWrapper(our custom wrapper over Esent.Interop) being created, at some point it throws EsentTooManyInstancesException.

So, what is the maximum no. of simultaneous instances that can be initialized? Or, are we missing any configuration-related stuffs??? Any kind of suggestion is appreciated. Thanks.

MrClan
  • 6,402
  • 8
  • 28
  • 43

1 Answers1

0

The limit for the number of instances is 1024. It sounds as if you're leaking instances.

But creating an instance is relatively expensive. You should be sharing the same instance, and instead creating multiple sessions for your access.

The instance is associated with a log file stream, and usually opens up the log files and database exclusively, so you'd get an ACCESS_DENIED error. I'm guessing that you're doing read-only access with your instances, and read-only instances will open the files read-only, with 'allow other readers' to access the files.

Hope that helps,

-martin

Martin Chisholm
  • 461
  • 2
  • 6
  • can you please post a link to some relevant information/resource??? We're have problems sharing sessions. Any code example would really be helpful. Thanks. – MrClan Apr 12 '13 at 08:09
  • Since you're talking about EsentTooManyInstancesException, I'm assuming that you're using ManagedEsent (managedesent.codeplex.com). Download the source code and take a look at the extensive test suite. There's also a nice HowDoI.cs file that shows some other examples. What sorts of problems were you having sharing sessions? Are you getting exceptions? Or data inconsistency? – Martin Chisholm Apr 14 '13 at 22:57
  • Thanks. We got it all sorted now. – MrClan Apr 15 '13 at 04:43