  /* Set up error handling. */
    dbenv-&gt;set_errpfx(dbenv, "txnapp");
    dbenv-&gt;set_errfile(dbenv, stderr);

<span class="bold"><strong>    /* Do deadlock detection internally. */
    if ((ret = dbenv-&gt;set_lk_detect(dbenv, DB_LOCK_DEFAULT)) != 0) {
        dbenv-&gt;err(dbenv, ret, "set_lk_detect: DB_LOCK_DEFAULT");
        exit (1);
    }</strong></span>

    /*
     * Open a transactional environment:
     *    create if it doesn't exist
     *    free-threaded handle
     *    run recovery
   