JetSeek(sesid, tableid, 0) can cause a hang!

JetSeek() takes three parameters, a JET_SESID, a JET_TABLEID and a JET_GRBIT. With a lot of esent APIs that take a grbit, passing in 0 is a good way to get the default options, but JetSeek should never be called with a grbit of 0. The problem is that all the JetSeek options are non-zero (e.g. JET_bitSeekEQ is actually 0x1). While passing in 0 is invalid older versions of esent don't check the argument and instead will perform a seek, but may leave a database page locked which eventually caused a hang. Later versions of esent.dll will correctly return JET_errInvalidGrbit.

So, if you want to do an exact seek, using JET_bitSeekEQ, not 0 as the grbit to JetSeek.