OGRVRT Layers not releasing DB Connections

Frank Warmerdam fwarmerdam at GMAIL.COM
Fri Aug 5 10:23:01 PDT 2005


On 8/5/05, IMD Listuser <imd_listuser at comcast.net> wrote:
> Greetings,
> 
> Im using Mapserver 4.6 from hobu and have just noticed that I am running
> out of database connections to my SQL Server database. Ive looked at the
> docs specifying how to use the PROCESSING "CLOSE_CONNECTION=DEFER" or
> PROCESSING "CLOSE_CONNECTION=NORMAL" items in the map file, but this
> does not seem to make a big difference in my case.
> 
> Could the list offer any further details on how to be sure that my
> OGRVRT/ODBC connection to SQL Server is colsing its connection when
> completed?

Charlie, 

I assume you are using a VRT file referencing SQL Server via
ODBC?  Just with normal CGI mapserv?  

If you run mapserv (or shp2img) in debug mode, you should see messages 
like the following when the VRT file is closed within MapServer:

  msOGRLayerClose(...).

With shp2img I can see these messages if I do "shp2img -all_debug 1 ...". 

To be really sure that the low level ODBC connection is being shutdown
properly we would need to add some debuging output in the 
CloseConnection() method in gdal/port/cpl_odbc.cpp.  

If the ODBCSession is being properly shutdown then things are out of
our control.  If not, then there is a bug in the cleanup at some level.

I would add that OGR's processing of the CLOSE_CONNECTION is 
different and distinct from the RDBMS derivers.  I would suggest you 
avoid using the processing directive unless you find you have a specific
need.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the MapServer-users mailing list