Opened 18 years ago

Closed 18 years ago

#1757 closed defect (fixed)

PROCESSING "CLOSE_CONNECTION=DEFER" fails with FastCGI

Reported by: ed@… Owned by: warmerdam
Priority: high Milestone:
Component: PostGIS Interface Version: 4.8
Severity: normal Keywords:
Cc:

Description

I'm having an issue with PROCESSING "CLOSE_CONNECTION=DEFER" when using mapserver. 

If i comment out the line my map file works, but if uncommented it breaks thus:
Postgresql reports the error as 'ERROR:  cursor "mycursor" already exists '   

I'm guessing this is a fastcgi config error.

This is just doing straight draws.

Change History (3)

comment:1 by chris@…, 18 years ago

Some further comments on the same/related bug.

Problem: Mapserver 4.8 can only render 1 layer at a time when run under
mod_fastcgi. If i request more than 1 in the same request, mapserver throws
"Failed to draw Layer X" where X is the second layer in the query string.

MS(FCGI) -> Layers with CLOSE_CONNECTION=DEFER ... Fails
MS(FCGI) -> Layers without DEFER ... Pass
MS(CGI) -> Layers with both ... Pass

No obvious errors in the log was being reported, only 

FastCGI: server "D:/ms4w/Apache/cgi-bin/48install/mapserv.fcgi" stderr:
MSPOSTGISLayerOpen -- shared connection not available.

comment:2 by fwarmerdam, 18 years ago

Status: newassigned
The mappostgis.c code was never closing "mycursor".  I added code to keep
track of the cursor name, and close it in msPOSTGISLayerClose() just before
releasing the connection to the pool.  

This doesn't affect non deferred connection closing because closing the
connection to the database discards objects like cursors. 

I have applied the change in 4.9, but not yet in 4.8.x.   


comment:3 by fwarmerdam, 18 years ago

Resolution: fixed
Status: assignedclosed
I have applied a simplified version of the fix in the 4.8 branch and it 
should be in the 4.8.4 release whenever that comes out.

Note: See TracTickets for help on using tickets.