code: public <S extends Storable> void register(Class<S> type, Cursor<S> cursor) {
          mLock.lock();
          try {
              checkClosed();
              if (mCursors == null) {
                  mCursors = new IdentityHashMap<Class<?>, CursorList<TransactionImpl<Txn>>>();
              }
  
              CursorList<TransactionImpl<Txn>> cursorList = mCursors.get(type);
              if (cursorList == null) {
                  cursorList = new CursorList<TransactionImpl<Txn>>();
                  mCursors.put(type, cursorList);
              }
  
              cursorList.register(cursor, mActive);
  
              if (mActive != null) {
                  mActive.register(cursor);
              }
          } finally {
              mLock.unlock();
          }
      }
docs: Registers the given cursor against the active transaction, allowing it
  to be closed on transaction exit or transaction manager close. If there
  is no active transaction in scope, the cursor is registered as not part
  of a transaction. Cursors should register when created.