I'm not sure this test is valid. Unless you have a transaction going on (you've called tx.begin()...), you'll never have a key locked or a transaction running after a put call. IOW, how can it be that even for transactional put that's called with an implicit transaction, the key will be somehow locked after the implicit transaction has finished?