ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/DB.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/DB.pm (file contents):
Revision 1.36 by root, Thu Apr 17 03:46:39 2008 UTC vs.
Revision 1.39 by root, Tue Sep 2 04:38:23 2008 UTC

23use Config; 23use Config;
24use BDB; 24use BDB;
25 25
26use DC; 26use DC;
27 27
28our $ODBDIR = "cfplus-" . BDB::VERSION . "-$Config{archname}"; 28our $ODBDIR = "cfplus-" . BDB::VERSION_MAJOR . "." . BDB::VERSION_MINOR . "-$Config{archname}";
29our $DBDIR = "client-" . BDB::VERSION . "-$Config{archname}"; 29our $DBDIR = "client-" . BDB::VERSION_MAJOR . "." . BDB::VERSION_MINOR . "-$Config{archname}";
30our $DB_HOME = "$Deliantra::VARDIR/$DBDIR"; 30our $DB_HOME = "$Deliantra::VARDIR/$DBDIR";
31 31
32unless (-d $DB_HOME) { 32unless (-d $DB_HOME) {
33 if (-d "$Deliantra::VARDIR/$ODBDIR") { 33 if (-d "$Deliantra::VARDIR/$ODBDIR") {
34 rename "$Deliantra::VARDIR/$ODBDIR", $DB_HOME; 34 rename "$Deliantra::VARDIR/$ODBDIR", $DB_HOME;
57 57
58 $env->set_errfile (\*STDERR); 58 $env->set_errfile (\*STDERR);
59 $env->set_msgfile (\*STDERR); 59 $env->set_msgfile (\*STDERR);
60 $env->set_verbose (-1, 1); 60 $env->set_verbose (-1, 1);
61 61
62 $env->set_flags (BDB::AUTO_COMMIT | BDB::LOG_AUTOREMOVE | BDB::TXN_WRITE_NOSYNC); 62 $env->set_flags (BDB::AUTO_COMMIT | BDB::REGION_INIT);
63 $env->set_flags (&BDB::LOG_AUTOREMOVE ) if BDB::VERSION v0, v4.7;
64 $env->log_set_config (&BDB::LOG_AUTO_REMOVE) if BDB::VERSION v4.7;
65
66 $env->set_timeout (3, BDB::SET_TXN_TIMEOUT);
67 $env->set_timeout (3, BDB::SET_LOCK_TIMEOUT);
68
63 $env->set_cachesize (0, 2048 * 1024, 0); 69 $env->set_cachesize (0, 2048 * 1024, 0);
64 70
65 db_env_open $env, $DB_HOME, 71 db_env_open $env, $DB_HOME,
66 BDB::CREATE | BDB::REGISTER | BDB::RECOVER | BDB::INIT_MPOOL | BDB::INIT_LOCK | BDB::INIT_TXN, 72 BDB::CREATE | BDB::REGISTER | BDB::RECOVER | BDB::INIT_MPOOL | BDB::INIT_LOCK | BDB::INIT_TXN,
67 0666; 73 0666;
436 db_env_txn_checkpoint $DB_ENV, 0, 0, 0, sub { }; 442 db_env_txn_checkpoint $DB_ENV, 0, 0, 0, sub { };
437 }; 443 };
438} 444}
439 445
440END { 446END {
447 db_env_txn_checkpoint $DB_ENV, 0, 0, 0
448 if $DB_ENV;
449
441 undef $TILE_SEQ; 450 undef $TILE_SEQ;
442 %DB_TABLE = (); 451 %DB_TABLE = ();
443 undef $DB_ENV; 452 undef $DB_ENV;
444} 453}
445 454

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines