- if( bdb->bi_txn ) {
- rc = txn_begin( bdb->bi_dbenv, NULL, &tid,
- bdb->bi_db_opflags );
- if( rc != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "=> bdb_tool_entry_put: txn_begin failed: %s (%d)\n",
- db_strerror(rc), rc, 0 );
- return NOID;
- }
+ rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &tid,
+ bdb->bi_db_opflags );
+ if( rc != 0 ) {
+ snprintf( text->bv_val, text->bv_len,
+ "txn_begin failed: %s (%d)",
+ db_strerror(rc), rc );
+#ifdef NEW_LOGGING
+ LDAP_LOG ( TOOLS, ERR, "=> bdb_tool_entry_put: %s\n", text->bv_val, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "=> bdb_tool_entry_put: %s\n",
+ text->bv_val, 0, 0 );
+#endif
+ return NOID;