***********************
** FILE NAME : database.cpp
** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
-** VERSION NUMBER : $Revision: 1.11 $
+** VERSION NUMBER : $Revision: 1.12 $
**
** DESCRIPTION : Implementation of the gnucomo database classes
**
/*****************************
$Log: database.cpp,v $
- Revision 1.11 2003-12-04 10:40:28 arjen
+ Revision 1.12 2003-12-22 10:28:26 arjen
+ Catch an exception if we can not setup a database transaction.
+
+ Revision 1.11 2003/12/04 10:40:28 arjen
Fixed name conflict with 'double log(double)'
Revision 1.10 2003/12/03 08:23:17 arjen
*****************************/
-static const char *RCSID = "$Id: database.cpp,v 1.11 2003-12-04 10:40:28 arjen Exp $";
+static const char *RCSID = "$Id: database.cpp,v 1.12 2003-12-22 10:28:26 arjen Exp $";
#include <AXE/date.h>
}
else
{
- // Create the transaction object
+ try
+ {
+ // Create the transaction object
- dbxact = new pqxx::Transaction(*dbconn, "GnuCoMo");
+ dbxact = new pqxx::Transaction(*dbconn, "GnuCoMo");
+ }
+ catch (std::exception &e)
+ {
+ *Log << "Cannot setup the database transaction: " << e.what() << "\n";
+ *Log << "You are probably using incompatible versions of PostgreSQL an libpqxx.\n";
+ exit(1);
+ }
gdb_refcount++;
}
}