[gdal-dev] Should we call RollbackTransaction if CommitTransaction fails?

Even Rouault even.rouault at spatialys.com
Thu Nov 28 07:19:59 PST 2024


Le 28/11/2024 à 15:10, Laurențiu Nicola via gdal-dev a écrit :
> Hi,
>
> Is there any advantage in trying to roll back a transaction that 
> failed to commit? Will it leave the dataset in a "more usable" state 
> than not doing anything?
If you intend to do transactions that may succeed afterwards, you will 
need to explicitly RollbackTransaction() to make drivers happy about the 
balancing of operations. This is similar to the expected use of BEGIN / 
COMMIT / ROLLBACK by SQL engines (at least just tried with PostgreSQL 
which requires an explicit ROLLBACK after a failure in a transaction to 
recover from it)
>
> Thanks,
> Laurentiu
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241128/b6cec30d/attachment.htm>


More information about the gdal-dev mailing list