code: public DatabaseOwner getDatabaseOwner()
      {
          DatabaseOwner databaseOwner = null;
          if (DBConstants.FALSE.equalsIgnoreCase(this.getProperty(SQLParams.AUTO_COMMIT_PARAM)))
              databaseOwner = this; // If auto-commit is off, I am the db owner.
          else
              databaseOwner = ((BaseApplication)this.getTask().getApplication());
          return databaseOwner;
      }
docs: Get the database owner for this recordowner.
  Typically, the Environment is returned.
  If you are using transactions, then the recordowner is returned, as the recordowner
  needs private database connections to track transactions.
  Just remember, if you are managing transactions, you need to call commit or your trxs are toast.
  Also, you have to set the AUTO_COMMIT to false, before you init your records, so the database
  object will be attached to the recordowner rather than the environment.
  @return The database owner.