Here's the log:
This only happens on WinXP/32bit. The same operations on the same data
work fine on Win7/64bit. Maybe it is related to the Esent version?
Tobias
> http://pastie.org/3602347
>
> This only happens on WinXP/32bit. The same operations on the same data
> work fine on Win7/64bit. Maybe it is related to the Esent version?
PS: This is what the application is doing at this point:
var docs = DocumentDatabase.GetDocumentsWithIdStartingWith("Sales",
skip, 1024);
Tobias
Works on Win7, but crashes on WinXP.
Tobias
> Can you check what the value of SystemParameters.BookmarkMost is?
It's 256.
At this line:
I see, that bookmark.Length is 0. Didn't had a chance yet to do any
further debugging.
> I don't have an XP machine handy, would it be possible to do a skype
> session to resolve this?
Tomorrow, when I'm back at work. I'm already at home and only have remote
access to my development and the XP machine.
Tobias
> I can't see how this can happen.
> JetGetSecondaryIndexBookmark is there to set things up, and I can't see it
> returning zero there.
> I check , and it is supported on win XP
"actualBookmarkSize" (=primary key bookmark buffer size) returned by
JetGetSecondaryIndexBookmark is 0 while "ignored" (=secondary key buffer
size) isn't.
...but I can't explain this either.
Tobias
> I guess it is possible that on XP, if the first buffer isn't big enough,
> it won't update the second buffer?
But why should the first buffer be too small?
On Win7 the buffer sizes are 1001 and on WinXP they are 256.
On Win7 AND WinXP I see the actual size of the secondary key never beeing
larger than 26. But the size of the primary key always is returned with 0
on WinXP (and 5 on Win7).
Tobias
> What is we would pass a null to the first buffer?
Passing null, 0 for the secondary key buffer causes a "Buffer too small"
exception as expected.
I'll do some debugging at the Managed Esent as soon as I'm back in the
office to see what the actual return value of JetGetSecondaryIndexBookmark is.
You have more insight into the Esent-interface. How should a tiny test
program look like that just opens the Esent DB and runs
JetGetSecondaryIndexBookmark?
Tobias
> I attached a minimal program that uses this.
...small bug in format string, but it works just fine:
Pri 4 Sec 16
Tobias
I've enabled a trace log for Managed Esent:
Win7: http://pastie.org/3607189
WinXP: http://pastie.org/3607194
Tobias
PS: This was for opening an existing DB and doing a single
GetDocumentsWithIdStartingWith() call.
Tobias
> What happen if you continue to do iterations on the data? Api.TryMoveNext() ?
Same return values:
Pri 4 Sec 16
Pri 4 Sec 16
Pri 4 Sec 16
Pri 4 Sec 16
...
Tobias
I tried to reproduce every single Esent-API-call from
GetDocumentsWithIdStartingWith(), but I fail to reproduce this problem in
isolation.
But on WinXP GetDocumentsWithIdStartingWith() fails consistently.
Tobias
> Okay, I'll take a look on Sunday.
Ok.
To add some extra weirdness to the problem:
Map/reduce, which uses the OptimizedIndexReader as well, works fine on
WinXP and the actualBookmarkSize returned by JetGetSecondaryIndexBookmark
is > 0.
Tobias
JetGetSecondaryIndexBookmark is called for the "by_key" index which is
primary. May this be the issue?
Tobias
> Map/reduce, which uses the OptimizedIndexReader as well, works fine on
> WinXP and the actualBookmarkSize returned by JetGetSecondaryIndexBookmark
> is > 0.
...my fault - wrong line. It's not primary.
Tobias
Modify your esent-only test program to create the index with:
CreateIndexGrbit.IndexDisallowNull | CreateIndexGrbit.IndexUnique
instead of just CreateIndexGrbit.IndexDisallowNull.
In this case, it fails on WinXP and prints:
Pri 0 Sec 20
But why?
Tobias
// Be careful with ColumndefGrbit.ColumnNotNULL. Older versions of ESENT // (e.g. Windows XP) do not support this grbit for tagged or variable columns // (JET_coltyp.Text, JET_coltyp.LongText, JET_coltyp.Binary, JET_coltyp.LongBinary)
http://managedesent.codeplex.com/discussions/348886
Tobias
> Okay, that answer gives us the solution, I'll move to Api.JetGetBookmark,
> instead.
I've cherry-picked this into stable and tested it - works fine!
Thanks!
BTW: Any plans for a new stable?
Tobias