Re: [mapserver-users] How use ogr provider with spatialite "read only" clause

2018-01-10 Thread Eichner, Andreas - SID
According to msOGRFileOpen(mapogr.cpp:1194):
hDS = OGROpen( pszDSSelectedName, MS_FALSE, NULL );
I would say that MapServer _always_ opens an OGR datasource readonly (See 
http://www.gdal.org/ogr__api_8h.html#a2da3630231780d519543d1679c83e62f ).

> -Original Message-
> From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org]
> On Behalf Of Andrea Peri
> Sent: Wednesday, January 10, 2018 12:29 PM
> To: mapserver-users@lists.osgeo.org
> Subject: [mapserver-users] How use ogr provider with spatialite "read
> only" clause
> 
> Hi,
> 
> Usually we use the spatialite db as ordinary datasource for ours
> mapserver wms.
> 
> 
> Now I discovered that the last versions of spatialite always test
> automatically the version of the DB sqlite and if verify that the db was
> create using an older spatialite version.
> 
> TRY TO UPDATE the spatialite system tables WHEN the connection was
> closed.
> 
> 
> This probably is a good strategy for an ordinary desktop application.
> 
> But more risk pendent when used on a mpaserver that could have more than
> one connection open on the same DB sqlite.
> 
> 
> To avoid this the standard solution used from the spatialite driver is
> to check if the DB is open in READ-ONLY mode.
> 
> 
> And avoid to write and update the db when it is in read-only mode.
> 
> 
> So my trouble now is how the change the usual connection string in the
> mapfile to say to the OGR driver to open the sqlite/spatialite using the
> "read-only" mode.
> 
> Is this possible ?
> 
> 
> Many thx
> 
> 
> A.
> 
> 
> --
> 
> -
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -
> 
> 

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] How use ogr provider with spatialite "read only" clause

2018-01-10 Thread Yves Jacolin
Hello Andrea,

Can't you do that by "chmod" the file?

Y.

2018-01-10 12:28 GMT+01:00 Andrea Peri :

> Hi,
> Usually we use the spatialite db as ordinary datasource for ours mapserver
> wms.
>
> Now I discovered that the last versions of spatialite always test
> automatically the version of the DB sqlite and if verify that the db was
> create using an older spatialite version.
>
> TRY TO UPDATE the spatialite system tables WHEN the connection was closed.
>
> This probably is a good strategy for an ordinary desktop application.
> But more risk pendent when used on a mpaserver that could have more than
> one connection open on the same DB sqlite.
>
> To avoid this the standard solution used from the spatialite driver is to
> check if the DB is open in READ-ONLY mode.
>
> And avoid to write and update the db when it is in read-only mode.
>
> So my trouble now is how the change the usual connection string in the
> mapfile to say to the OGR driver to open the sqlite/spatialite using the
> "read-only" mode.
>
> Is this possible ?
>
> Many thx
>
> A.
>
> --
> -
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -
>
>
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>



-- 
Training and support manager
Camptocamp France SAS
Bâtiment le Dauphin - 1er étage
18 rue du Lac Saint André
73382 Le Bourget-du Lac

Tel (France) : +33 4 58 48 20 43
Tel (Switzerland) : +41 21 619 10 43
Mob. : +33 6 18 75 42 21

email : yves.jaco...@camptocamp.com
http://www.camptocamp.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] How use ogr provider with spatialite "read only" clause

2018-01-10 Thread Andrea Peri
Hi,
Usually we use the spatialite db as ordinary datasource for ours mapserver
wms.

Now I discovered that the last versions of spatialite always test
automatically the version of the DB sqlite and if verify that the db was
create using an older spatialite version.

TRY TO UPDATE the spatialite system tables WHEN the connection was closed.

This probably is a good strategy for an ordinary desktop application.
But more risk pendent when used on a mpaserver that could have more than
one connection open on the same DB sqlite.

To avoid this the standard solution used from the spatialite driver is to
check if the DB is open in READ-ONLY mode.

And avoid to write and update the db when it is in read-only mode.

So my trouble now is how the change the usual connection string in the
mapfile to say to the OGR driver to open the sqlite/spatialite using the
"read-only" mode.

Is this possible ?

Many thx

A.

-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users