code: public void startTransaction()
     {
        Long key = Long.valueOf(Thread.currentThread().getId());
        TransactionImpl tx = txs.get(key);
  
        if (tx == null)
        {
           TransactionImpl newTx = new TransactionImpl(key);
           tx = txs.putIfAbsent(key, newTx);
           if (tx == null)
              tx = newTx;
        }
  
        tx.active();
     }
docs: Start a transaction