I had another look at the patch, and something bothers me about ensureOpen() and how close is set to true. Currently, if I call close(), and another thread has an instance of TR, any operations he'll try to do will fail by ensureOpen().
I think that we should remove 'close' and check on IR.refCount(). When it's <= 0, we're closed for business, otherwise the TR should not be marked close().
I looked at IndexReader and two things:
- Its ensureOpen checks refCount()
- Its close looks entirely redundant ...