Uncensored to stop crashing. More fixes on the way...
$Log$
+ Revision 573.48 2000/12/12 04:20:03 ajc
+ * Made the transaction open/close a global thing, in a frantic attempt to get
+ Uncensored to stop crashing. More fixes on the way...
+
Revision 573.47 2000/12/11 06:08:41 ajc
* Removed the housekeeper thread, moved terminate_idle_sessions() out to a
timer event, and check_sched_shutdown() to the end of the worker thread
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
lprintf(7, "Opening databases\n");
open_databases();
+ cdb_begin_transaction();
if (do_defrag) {
defrag_databases();
}
- cdb_begin_transaction();
-
check_ref_counts();
lprintf(7, "Creating base rooms (if necessary)\n");
lprintf(7, "Seeding the pseudo-random number generator...\n");
gettimeofday(&tv, NULL);
srand(tv.tv_usec);
-
- cdb_end_transaction();
}
+
+
/*
* Cleanup routine to be called when the server is shutting down.
*/
/* Run any cleanup routines registered by loadable modules */
for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
(*fcn->h_function_pointer)();
- }
+ }
/* Close databases */
lprintf(7, "Closing databases\n");
+ cdb_end_transaction();
close_databases();
/* Do system-dependent stuff */
struct cdbssd *ssd_arr = NULL;
int num_ssd = 0;
#define MYCURSOR ssd_arr[CC->cs_pid].cursor
-#define MYTID ssd_arr[CC->cs_pid].tid
+/* #define MYTID ssd_arr[CC->cs_pid].tid */
+DB_TXN *MYTID;
/*
* Ensure that we have enough space for session-specific data. We don't
else if (!strcasecmp(buf, "message")) artv_import_message();
else break;
- /* Yes, this is correct: end *then* begin. Since we're in a
- * session command loop, there's already a transaction in
- * progress. We want to end it and then begin a new one at the
- * end of every object import, otherwise the entire import
- * logs as a single transaction. Not only would that be a bad
- * idea, but it'll actually crash the db when importing very
- * large files.
- */
- cdb_end_transaction();
- cdb_begin_transaction();
-
}
lprintf(7, "Invalid keyword <%s>. Flushing input.\n", buf);
while (client_gets(buf), strcmp(buf, "000")) ;;
* Load any server-side modules (plugins) available here.
*/
lprintf(7, "Initializing loadable modules\n");
- cdb_begin_transaction();
if ((moddir = malloc(strlen(bbs_home_directory) + 9)) != NULL) {
sprintf(moddir, "%s/modules", bbs_home_directory);
DLoader_Init(moddir);
free(moddir);
}
- cdb_end_transaction();
/*
* The rescan pipe exists so that worker threads can be woken up and
while (!time_to_die) {
- cdb_begin_transaction();
/*
* A naive implementation would have all idle threads
*/
begin_critical_section(S_I_WANNA_SELECT);
+ cdb_end_transaction();
+ cdb_begin_transaction();
SETUP_FD: memcpy(&readfds, &masterfds, sizeof masterfds);
highest = masterhighest;
begin_critical_section(S_SESSION_TABLE);
check_sched_shutdown();
- cdb_end_transaction();
}
/* If control reaches this point, the server is shutting down */