glom r1859 - in trunk: . glom



Author: jhs
Date: Sun Jan 25 17:13:32 2009
New Revision: 1859
URL: http://svn.gnome.org/viewvc/glom?rev=1859&view=rev

Log:
2009-01-25  Johannes Schmid <jschmid openismus com>

	* glom/base_db.cc:
	Some cosmetic changes to error messages and removed the reference()
	call that is obviously caused by a bug in the postgres provider.


Modified:
   trunk/ChangeLog
   trunk/glom/base_db.cc

Modified: trunk/glom/base_db.cc
==============================================================================
--- trunk/glom/base_db.cc	(original)
+++ trunk/glom/base_db.cc	Sun Jan 25 17:13:32 2009
@@ -291,6 +291,8 @@
   }
 #endif
   int exec_retval = -1;
+  /*if (params)
+    params->reference(); // TODO: bug in libgda?*/
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
   {
@@ -1447,20 +1449,28 @@
 Glib::RefPtr<Gnome::Gda::Connection> Base_DB::get_connection() const
 {
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
-  sharedptr<SharedConnection> sharedconnection = connect_to_server();
+  sharedptr<SharedConnection> sharedconnection;
+  try
+  {
+     sharedconnection = connect_to_server();
+  }
+  catch (const Glib::Error& error)
+  {
+    std::cerr << "Base_DB::get_connection(): " << error.what() << std::endl;
+  }
 #else
   std::auto_ptr<ExceptionConnection> error;
   sharedptr<SharedConnection> sharedconnection = connect_to_server(0, error);
   if(error.get())
   {
-    std::cerr << "Base_DB::insert_example_data failed (query was: " << strQuery << "): " << error->what() << std::endl;
+    std::cerr << "Base_DB::get_connection(): " << error->what() << std::endl;
     // TODO: Rethrow? 
   }
 #endif
 
   if(!sharedconnection)
   {
-    std::cerr << "Base_DB::insert_example_data: No connection yet." << std::endl;
+    std::cerr << "Base_DB::get_connection(): No connection yet." << std::endl;
     return Glib::RefPtr<Gnome::Gda::Connection>(0);
   }
 
@@ -1545,7 +1555,6 @@
         //After this, the Parser will know how many SQL parameters there are in 
         //the query, and allow us to set their values.
         const Glib::ustring strQuery = "INSERT INTO \"" + table_name + "\" (" + strNames + ") VALUES (" + strVals + ")";
-        params->reference(); // bug in libgda or libgdamm?
         insert_succeeded = query_execute(strQuery, params);
         if (!insert_succeeded)
           break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]