-/* $Id: main.c,v 1.112.2.1 2004-09-26 20:49:02 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
+/* $Id: main.c,v 1.112.2.2 2005-01-21 13:23:03 adam Exp $
+ Copyright (C) 1995-2005
Index Data Aps
This file is part of the Zebra server.
char *configName = 0;
int nsections = 0;
int enable_commit = 1;
- char *database = "Default";
+ char *database = 0;
Res res = res_open(0, 0, 0);
int trans_started=0;
zebra_shadow_enable (zh, enable_commit);
}
- if (zebra_select_database (zh, database))
+ if (database && zebra_select_database (zh, database))
{
logf(LOG_FATAL, "Could not select database %s errCode=%d",
database, zebra_errCode(zh) );
-/* $Id: zebraapi.c,v 1.120.2.2 2004-11-26 11:06:12 adam Exp $
+/* $Id: zebraapi.c,v 1.120.2.3 2005-01-21 13:23:03 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
{
if (!zh->res)
{
+ /* no database has been selected - so we select based on
+ resource setting (including group)
+ */
+ const char *group = res_get(zh->service->global_res, "group");
+ const char *v = res_get_prefix(zh->service->global_res,
+ "database", group, "Default");
+ zebra_select_database(zh, v);
+ }
+ if (!zh->res)
+ {
zh->errCode = 2;
zh->errString = "zebra_begin_trans: no database selected";
return -1;