Created
January 23, 2016 00:12
-
-
Save jef-n/2f9c4fa778d165cdbda0 to your computer and use it in GitHub Desktop.
restart transaction when CreateFeature fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur ../orig/gdal-2.0.2/apps/ogr2ogr.cpp ./apps/ogr2ogr.cpp | |
--- ../orig/gdal-2.0.2/apps/ogr2ogr.cpp 2016-01-22 11:51:09.000000000 +0100 | |
+++ ./apps/ogr2ogr.cpp 2016-01-23 00:43:21.392717800 +0100 | |
@@ -4049,6 +4049,17 @@ | |
{ | |
CPLDebug( "OGR2OGR", "Unable to write feature " CPL_FRMT_GIB " into layer %s.\n", | |
poFeature->GetFID(), poSrcLayer->GetName() ); | |
+ | |
+ if( bLayerTransaction ) | |
+ { | |
+ poDstLayer->RollbackTransaction(); | |
+ poDstLayer->StartTransaction(); | |
+ } | |
+ else | |
+ { | |
+ poODS->RollbackTransaction(); | |
+ poODS->StartTransaction(bForceTransaction); | |
+ } | |
} | |
end_loop: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment