Skip to content

Sync timing issue for unit tests #263

Answered by atownley
atownley asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, thanks. You got me: operator error on the transactions. I didn't notice the #transaction vs. #transactionSync in the API docs. I have updated it to switch based on the type of write I'm doing, and everything works swimmingly now.

The this pointer is being used inside a callback, e.g.,:

for(var i = 0; i < arr.length; ++i)
{
  cb.apply(arr[i], i);
}

items.each(function() {
  var val = this;
});

During the iteration, the values in the LMDB-backed data structures are being accessed.

However, given that I was using async transactions by mistake, who knows what it was really pointing to as far as the stack frame and local memory assignments.

The superbly awesome news is that it was all do…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@atownley
Comment options

@kriszyp
Comment options

@atownley
Comment options

Answer selected by atownley
@atownley
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants