code: public TransactionImpl createTransaction(boolean readOnly)
    {
      TransactionImpl transaction = transactionsCache.get();
      if(transaction != null) {
        transaction.incrementTransactionNestingLevel();
      }
      else {
        transaction = new TransactionImpl(this, transactionTimeout, readOnly);
        transactionsCache.set(transaction);
      }
      return transaction;
    }
docs: Create a database handler. Create a new {@link TransactionImpl} and store it on current thread so that it can be
  retrieved by application code. This method is invoked by {@link TransactionManagerImpl} when start a new
  transaction. Note that created handler is valid only on current transaction boundaries.
  
  @param readOnly if this flag is true create a read-only transaction, supporting only database select operations.
  @return newly created database handler.