[gdal-dev] transactions and ExecuteSQL

Martin Landa landa.martin at gmail.com
Fri Aug 19 08:10:02 EDT 2011


Hi,

how to deal with transactions when calling ExecuteSQL()? Example for
PostGIS layer

"""
    poDS = OGRSFDriverRegistrar::Open("PG:dbname=pgis_nc", FALSE);

    poLayer = poDS->GetLayerByName("b_1");
    poLayer->StartTransaction();

    poDS->ExecuteSQL("update b_1 set objectid = 5 where cat = 4", NULL, NULL);

    poLayer->CommitTransaction();
"""

Calling StartTransaction() and CommitTransaction() has no effect since
ExecuteSQL() calls FlushSoftTransaction(). How to deal with that?

Thanks in advance, Martin

-- 
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the gdal-dev mailing list