code: public static TxConfig external() {
          final TxConfig cfg = new TxConfig();
          cfg.external = true;
          // currently only only notx and optimistic transactions supported
          cfg.txtype = ODatabaseRecordThreadLocal.instance().get()
                  .getTransaction() instanceof OTransactionNoTx
                  ? OTransaction.TXTYPE.NOTX : OTransaction.TXTYPE.OPTIMISTIC;
          cfg.rollbackOn.clear();
          cfg.ignore.clear();
          return cfg;
      }
docs: External transaction is a re-use of database instance already bound to thread. For example,
  <pre>{@code
  // transaction opened manually
  ODatabaseDocumentTx db = new ODatabaseDocumentTx();
  // only after that it could be detected
  db.activateOnCurrentThread();
  
  // context is PersistentContext, but TxTemplate may be called directly
  context.doInTransaction(TxConfig.external(), () -> {
  // here we can use external transaction
  })
  
  // connection closed manually
  db.close();
  }</pre>
  <p>
  External transaction is a way to re-use already existing connection (e.g. managed by orient itself) in
  guice beans. The case must be applied with care: as connection is managed outside of guice, external
  transaction scope must be exactly between manual db open and close (otherwise you will have error due
  to not bound db instance). Rollback and commit actions will not affect connection.
  <p>
  Type of transaction is resolved from external connection.
  <p>
  One example usage case is non blocking async queries listener: there orient create connection in separate
  thread and calls listener multiple times, so if usual transaction would be used inside listener,
  it will override existing orient transaction and orient logic execution will break.
  
  @return external transaction config