$NetBSD: patch-af,v 1.6 2007/06/15 23:28:17 wiz Exp $

--- prayer/mydb_db3.c.orig	2006-04-20 10:10:00.000000000 +0000
+++ prayer/mydb_db3.c
@@ -139,13 +139,23 @@ static int myinit(const char *dbdir, int
     dbenv->set_verbose(dbenv, DB_VERB_WAITSFOR, 1);
   }
 #ifdef DB_VERB_CHKPOINT
+#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 3
   if (CONFIG_DB_VERBOSE > 1) {
     dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, 1);
   }
 #endif
+#endif
   dbenv->set_lk_detect(dbenv, CONFIG_DEADLOCK_DETECTION);
 
+#if DB_VERSION_MAJOR >= 4
+  r = dbenv->set_lk_max_locks(dbenv, 50000);
+  if (!r)
+    r = dbenv->set_lk_max_lockers(dbenv, 50000);
+  if (!r)
+    r = dbenv->set_lk_max_objects(dbenv, 50000);
+#else
   r = dbenv->set_lk_max(dbenv, 50000);
+#endif
   if (r) {
     log_panic("DBERROR: set_lk_max(): %s", db_strerror(r));
     abort();
