code: public static TransactionContext transactionContext(SharedSessionContractImplementor session) {
  		TransactionCoordinator transactionCoordinator = session.getTransactionCoordinator();
  		if ( transactionCoordinator != null && transactionCoordinator.getTransactionDriverControl() != null ) {
  			TransactionDriver driver = transactionCoordinator.getTransactionDriverControl();
  			if ( driver instanceof IdentifiableDriver ) {
  				return new TransactionContextImpl( (IdentifiableDriver) driver );
  			}
  		}
  		return EmptyTransactionContext.INSTANCE;
  	}
docs: Return a transaction context given the session implementor; it never returns {@code null}.
  
  @param session current {@link SessionImplementor}
  @return the {@link TransactionContext}