Quantcast
Channel: ESENT Managed Interface
Viewing all 496 articles
Browse latest View live

Commented Unassigned: Invalid API Parameter on Windows Server 2008R2 [13848]

$
0
0
I developed a web app on windows 7 in C# visual studio 2015 and using iisexpress. When launching esent will initialize correctly with a supplied directory and i can create a persistent dictionary and read/write keys. Once I move my app to a windows server 2008r2 box, I get an error during initialization: Microsoft.Isam.Esent.Interop.EsentInvalidParameterException: Invalid API parameter.

Any idea on why I'm getting this error? I've tried a few things like checking to make sure my service account has permissions, modifying the app pool to allow 32bit or not, and a various other changes to no effect.
Comments: Found the fix. The default settings are sending the waypointlatency parameter with value of 1 to the setinstanceparams method which is a windows 7 only setting. I removed the setting from the persistentdictionarydefaultconfig and that fixed everything. I had to make my own build of esent to do this. Not sure if there's a better method to do this when calling the persistent dictionary. It seemed like there was some feature detection going on for different system builds, but I didn't dig too deep into it.

New Post: How to determine JetSetSystemParameter values

$
0
0
Is there an easy way to determine the list of parameters that need to be set with JetSetSystemParameter given just the database path?

I'm working with reading/writing to a database that I didn't create... so I need to know:
TempPath, LogFilePath, SystemPath, AlternateDatabaseRecoveryPath, CircularLog, LogFileSize to match whatever the original author has required.

Do I just have to poke around and find *chk, *log files, etc to infer these settings?

Commented Unassigned: GetTableColumns broken [13707]

$
0
0
1.9.3.2 - The overloaded method with signature GetTableColumns(JET_SESSID, JET_DBID, string) returns garbage column names. The other overload produces correct names.

The attached image shows a pause in the debugger and tooltip with the offending column names.

Greg K
Comments: It seems that this bug has been fixed in release 1.9.3.3. Thx.

Created Unassigned: Port of Microsoft.Database.Collections.Generic on UWP [13849]

$
0
0
Hey guys,

Are there any plans to make Microsoft.Database.Collections.Generic on UWP platform? Looking at the source code I can already see the RT projects but they don't work with UWP. Are there any plans/timeline?

New Post: Q: Open the Active Directory Database?

$
0
0
Wondering if I can use this Managed Interface to open an AD ESENT DB.

Thanks in advance!
Adam

New Post: Q: Open the Active Directory Database?

$
0
0
Definitely! Look at my DSInternals project, that leverages this library to read and modify ntds.dit files. Is there anything specific you would like to do with an AD database?

New Post: How to determine JetSetSystemParameter values

$
0
0
Yep, you have to poke around in most cases. Some applications might store these paths in registry.
If you only want to read a clean DB, you only need to know page size, which can be infered from the DB file.

New Post: Q: Open the Active Directory Database?

$
0
0
Brilliant! I'm trying to determine the physical size of an object in the database, or more accurately, the size of many hundreds of thousands of objects (:

New Post: Q: Open the Active Directory Database?

$
0
0
This might be done by extending the DirectoryAgent class. I was actually planning to implement such feature, but I am currently quite busy and it is not that trivial, even when using my abstraction layer.

New Post: What to do if JetRollback fails?

$
0
0
JetRollback's documentation has this comment:

"On failure, the transactional state of the session will remain unchanged. No change to the database state will occur. A failure during rollback is considered to be a catastrophic database error." What does "a catastrophic database error mean"? Should the instance be terminated and re-initialized? Should the application exit? Does answering that depend on how it fails?

As "background", the application was unintentionally crashing itself when JetRollback failed (in some situations), and that's been addressed, but after reading JetRollback's documentation more closely, I've been wondering if fixing that by not crashing was actually the right way to address it, or if we should have done a failfast terminate if JetRollback ever fails.

New Post: What to do if JetRollback fails?

$
0
0
Yes, the instance should be terminated and re-initialized.

The safest option is to treat rollback failures as instance unavailable. In most cases it is the only available option, and the engine will return JET_errInstanceUnavailable on any subsequent operations.

You should call JetTerm() with JET_bitTermDirty to cleanup resources. Then recreate the instance and run recovery.

New Post: How to avoid / handle VersionStoreOutOfMemory

$
0
0
I'm new to Esent, and am trying to use PersistentDictionary, but I keep hitting VersionStoreOutOfMemory. Are there any existing docs that describe the conditions that lead to this, what steps can be taken to avoid this, and what can be done at runtime when this occurs?

I've found that increasing MaxVerPages avoids it in my test app, but I'm writing a server app so need a robust recovery mechanism when it does occur.

Commented Unassigned: Negative owned pages from JetGetTableInfo [13237]

$
0
0
I have this code:

```
int ownedPages;
Api.JetGetTableInfo(session, tbl, out ownedPages, JET_TblInfo.SpaceOwned);


```
And it returns negative results

Same for:
```

JET_OBJECTINFO result;
Api.JetGetTableInfo(session, tbl, out result, JET_TblInfo.Default);
var usedSize = result.cPage*SystemParameters.DatabasePageSize;
```

Any reason for that?
Comments: Integer overflow? If your database is bigger than 2GiB then try casting result.cPage to a long _before_ the multiplication.

New Post: How to avoid / handle VersionStoreOutOfMemory

$
0
0
Increasing MaxVerPages is the way to avoid VersionStoreOutOfMemory. The more concurrent/high-throughput your application is the more version store you will need.

New Post: How to avoid / handle VersionStoreOutOfMemory

$
0
0
Thanks for your prompt response, that's helpful. If you may, I have some further questions. What exactly is the version store? Is it an in-memory buffer that gets filled only when the rate of incoming data exceeds the disk writing throughput? I.e. if the version store fills up due to a period of high activity, will it empty out when the load drops? Or is it some finite resource that, once full, is full forever? Either way, what can I do at runtime if the limit is reached - as is bound to happen at some point?

My usage is as a local cache of remote data. As such, it'll receive a massive influx of data upon first use, then a steady trickle feed as data changes over time. The process needs to continue running for weeks.

New Post: How to avoid / handle VersionStoreOutOfMemory

$
0
0
The version store is an in-memory list of changes made by database transactions. The version store is used for rollback and MVCC, specifically:
  • Rollback: when a transaction wants to abort it uses the version store entries to undo all its operations.
  • Concurrency control: version store entries are used to lock records.
  • Snapshot isolation: a session should only see changes that were committed before the current transaction began. The version store is used to generate the correct view of the database as transactions read records.
If a transaction starts but never commits the version store will always fill up because esent has to keep track of all modifications made to the database since the transaction began. This should not be the case with PersistentDictionary because it uses short transactions. In your case I believe that a high throughput rate is creating a lot of versions. They are removed from memory by a background thread so you just need a larger buffer to let the background thread catch up.

Source code checked in, #1a868f3e44f6d52ef4f8690ea34753ffe0bc1260

$
0
0
ManagedEsent 1.9.4. Some bug fixes

Released: ManagedEsent 1.9.4 (Jul 06, 2016)

Created Release: ManagedEsent 1.9.4 (Jul 06, 2016)

New Post: Unmanaged memory use with Managed Esent / PersistentDictionary

$
0
0
How to set CacheSizeMax after the constructor of PersistentDictionary has been run?

Here is my scenario:
  • I have a code that uses PersistentDictionary() which will cause the database cache to be over 3GB.
  • After that code is run, I want to set CacheSizeMax to 100MB to force it to dump majority of the cached data.
  • I do NOT want to dispose the PersistentDictionary() object, because I am going to use this same object 10 minutes later.
The only way I can see about using CacheSizeMax is from the constructor like the following.
Is there a way to set it after using the dictionary without disposing it
        DatabaseConfig databaseConfig = new DatabaseConfig()
        {
            CacheSizeMax = 3 * 1024 * 1024 * 1024 / 8192;  // That is 3GB
        };

        var dictionary = new PersistentDictionary<TKey, string>("myfile", databaseConfig);
        // Use dictionary now...
        // How to set CacheSizeMax to 100MB after using the dictionary without disposing it?
Thanks.
Viewing all 496 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>