Layer Virtualization and LayerCloseConnection vs LayerClose (SDE issues)

Howard Butler hobu at IASTATE.EDU
Fri Feb 24 15:30:17 EST 2006


Jani,

I found a problem with the SDE driver where we weren't closing out 
layer information.  The layer virtualization has two methods, 
LayerCloseConnection and LayerClose.  In SDE, they were both being 
used, and LayerClose was set to a NoOp function that was just 
returning success.  This wasn't allowing the SDE driver to free up 
its layer information and decrement the connection pool when a layer 
was closed.

I have fixed this by commenting out the definition of the 
layer->vtable->LayerCloseConnection method in the 
msSDELayerInitializeVirtualTable method, replacing the NoOp method to 
use our regular msSDELayerClose method, and removing the NoOp method 
completely.

Was there a reason why we took this approach in the SDE driver?  I 
vaguely remember possibly even asking for a LayerCloseConnection 
method, but I'm not sure.  Do you have any recollection?  I think the 
intent for layers using connection pooling is that each driver's Open 
and Close methods will take care of that and it wouldn't be needed in 
the layer virtualization.  Maybe that is not the case for a plugin 
layer that might be providing its own connection pooling?  Is that 
why there are two methods?

I think we could get by with just having LayerClose and LayerOpen 
deal with connection pooling issues entirely and not have to worry 
about them in the layer virtualization, but I'm not a 100% sure.  For 
one thing, I'd like to see the connection pool bubbled up to 
MapScript at some point, but I don't know where that should happen -- 
in the layer virtualization or through some other mechanism.

Howard



More information about the mapserver-dev mailing list