Ticket #433 (closed enhancement: fixed)

Opened 10 months ago

Last modified 6 months ago

PostGIS connection is not released when datasource is deleted

Reported by: springmeyer Owned by: artem
Priority: normal Milestone: 0.7.0
Component: PostGIS Input Driver Version: 0.6.0
Severity: Normal Keywords:
Cc: Patch Needs Improvement: no
Needs Docmentation: no Has Patch?: yes
Design Decision Needed: yes

Description


Attachments

postgis_release_connection.patch (1.0 kB) - added by springmeyer 10 months ago.
allows a connection to be released if del postgis_datasource is called
postgis_release_connection2.patch (1.9 kB) - added by springmeyer 10 months ago.
Add missing portion of patch, moving PGFinish out of ~Connection () destructor
postgis_release_connection3.patch (3.9 kB) - added by springmeyer 10 months ago.
making behavior a user adjustable parameter, allowing for the original, persistent and pooled connection to be maintained

Change History

Changed 10 months ago by springmeyer

allows a connection to be released if del postgis_datasource is called

Changed 10 months ago by springmeyer

  • has_patch set
  • summary changed from PostGIS connections are not released when datasource is deleted to PostGIS connection is not released when datasource is deleted
  • design_decision_needed set

Changed 10 months ago by springmeyer

Add missing portion of patch, moving PGFinish out of ~Connection () destructor

Changed 10 months ago by springmeyer

This needs more testing, however for one postgres layer this seems to work fine in either of 3 situations:

1) mapnik process ends 2) postgis datasource object is deleted 3) map containing the datasource is deleted

Illustration of #3:

>>> import mapnik
>>> m = mapnik.Map(45,45)
>>> mapnik.load_map(m,'pg.xml')
SELECT f_geometry_column, srid FROM geometry_columns WHERE f_table_name='world_worldborders' AND f_geometry_column='geometry'
setting geometry field to=geometry
setting SRID to=4326
using srid=4326
using geometry_column=geometry
unknown type_oid=16760
>>> del m
PostGIS: closed connection 0x86cc00
>>> exit()

Changed 10 months ago by springmeyer

making behavior a user adjustable parameter, allowing for the original, persistent and pooled connection to be maintained

Changed 10 months ago by springmeyer

  • status changed from new to closed
  • resolution set to fixed

applied in r1337

Changed 6 months ago by springmeyer

  • type changed from defect to enhancement
Note: See TracTickets for help on using tickets.