0

I wonder if there's a way to check whether a range exists on esent index.

Wher I run some other methods than "TryMoveNext" or "RetrieveColumn", (ie. Getting the table name list) the range is being reset.

This may be dangerous in some situations, ie:

  • I'm iterating subset of products using TryMoveNext and Retrieve.. methods.
  • The range is being reset by some sub-routine.
  • I'm getting full set of products without being notified.

If an user was intended to view his/her product basket, they'll see other people's baskets.

I would like to check whether index range exists, in order to place assertion that would warn me it doesn't exist anymore.

Is it possible to check whether there's a range on given index in ESENT?

AD

A.D.
  • 425
  • 3
  • 15

1 Answers1

1

I asked around, and no, there is no way to non-destructively check whether there's an index range set.

"No, I think whether the index range exists on the TABLEID / cursor is something the client would have to keep track of."

"The only hint that leaks is if you call JetSetIndexRange(JET_bitRangeRemove) which will fail if an index range wasn’t already set. However, that is obviously destructive if you wanted to know if you had one already and you wanted to keep it. "

Sorry that it's not the answer you wanted,

-martin

Martin Chisholm
  • 461
  • 2
  • 6
  • You may be able to use `JetIndexRecordCount` to check if the index range is still set. If this number increases, then somebody removed the index range. However you'll definitely want to use `crecMax` to avoid an entire table scan! https://msdn.microsoft.com/en-us/library/gg269267(v=exchg.10).aspx – Martin Chisholm Nov 15 '16 at 23:49