[postgis-users] msPOSTGISLayerCLose() called twice
Jan Hartmann
jhart at frw.uva.nl
Wed Aug 13 04:00:47 PDT 2003
Dave,
msPOSTGISLayerClose() *does* get called twice: once in msLayerClose()
(maplayer.c), and once in closeConnections() (mapfile.c). The second one
is in the connection pool code I added in January, the first one is in
the original layer-by-layer code. In fact, the second one should only be
called after the pooling code has been added for PostGIS. I remember
having discussed this with Steve Lime (i.e. synchronizing pooling and
non-pooling database code), but this seems to have slipped through. I am
not sure if closing an already closed layer will hurt (it does not seem
to have broken up anything until now), but if you want to be sure,
either remove the call in mapfile.c, or add the pooling code in
mappostgis.c.
Jan
David Blasby wrote:
> Daniel,
>
> I've noticed that msPOSTGISLayerClose() is being called once more than
> msPOSTGISLayerOpen()::
>
> msPOSTGISLayerOpen called
> msPOSTGISLayerWhichShapes called
> msPOSTGISLayerClose datastatement: the_geom from nodescomb_2003
> msPOSTGISLayerOpen called
> msPOSTGISLayerWhichShapes called
> msPOSTGISLayerClose datastatement: the_geom from nodescomb_2003
> msPOSTGISLayerOpen called
> msPOSTGISLayerClose datastatement: the_geom from nodescomb_2003
> msPOSTGISLayerOpen called
> in msPOSTGISLayerGetItems (find column names)
> msPOSTGISLayerClose datastatement: the_geom from nodescomb_2003
> msPOSTGISLayerClose datastatement: the_geom from nodescomb_2003
>
> I verified the last close - it is definately closing an already closed
> layer. This is during an itemnquery.
>
> Also, this looks like an awful lot of work for an itemnquery - whats it
> really supposed to be doing? It calls msPOSTGISLayerGetShape() twice
> for each of the 'itemn' results. Once without layer->items set, and
> once with it set. You'll notice that the shapes are retrieved from the
> database a total of 4 times (twice by rectange and twice by ID)!
>
> dave
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
More information about the postgis-users
mailing list