Bladeren bron

vlib/ogr: be quiet when trying to commit transaction (probably there is no active)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70245 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 8 jaren geleden
bovenliggende
commit
dd9a78be15
1 gewijzigde bestanden met toevoegingen van 7 en 2 verwijderingen
  1. 7 2
      lib/vector/Vlib/build_ogr.c

+ 7 - 2
lib/vector/Vlib/build_ogr.c

@@ -25,6 +25,7 @@
 
 #ifdef HAVE_OGR
 #include <ogr_api.h>
+#include <cpl_error.h>
 #endif
 
 #include "local_proto.h"
@@ -72,8 +73,12 @@ int Vect_build_ogr(struct Map_info *Map, int build)
 	return 0;
     }
     
-    if (OGR_L_TestCapability(ogr_info->layer, OLCTransactions))
-	OGR_L_CommitTransaction(ogr_info->layer);
+    if (OGR_L_TestCapability(ogr_info->layer, OLCTransactions)) {
+        CPLPushErrorHandler(CPLQuietErrorHandler); 
+	if (OGR_L_CommitTransaction(ogr_info->layer) != OGRERR_NONE)
+            G_debug(1, "Unable to commit transation");
+        CPLPushErrorHandler(CPLDefaultErrorHandler); 
+    }
 
     /* test layer capabilities */
     if (!OGR_L_TestCapability(ogr_info->layer, OLCRandomRead)) {