Hi,
I have a postgis table "geometry_table" that has a 1-to-many relation to 
another table "properties_table", where each geoemtry has many properties. 
These properties hold style values of geoemtries (e.g color, stroke-width, ... 
etc).
I have a CSS style document that's used to style this geometry_table layer, 
something like the following:

/*Lines*/
[GetStyleProperty(geomId, 'visible') = 'true'] [dimension(geometry) = 1] [@sd < 
GetStyleProperty(geomId, 'feature_max_scale')] [@sd > GetStyleProperty(geomId, 
'feature_min_scale')]{
   stroke: [GetStyleProperty(geomId, 'stroke_color')];
   stroke-width: [GetStyleProperty(geomId, 'stroke_width')];
   stroke-dasharray: [GetStyleProperty(geomId, 'stroke_dasharray')];
   stroke-opacity: [GetStyleProperty(geomId, 'opacity')];
}

The function "GetStyleProperty" is a custom Geotool function I've created to 
read a given property name of a given geometry from the DB. This function first 
opens a DB connection, then execute a DB stored function, then close the 
connection.

My problem is that loading the geometry_table layer takes too much time (more 
than 6 seconds to display arround 10 featrues only). I have recognized that the 
problem is from my CSS Style document, because if I use another style document 
(e.g the generic one) the layer is dispalyed in less than one second. I've 
measured the execution time of "GetStyleProperty" function and found that 
quarter of the time is wasted in opening the DB connection.

SO, my question is: instead of opening a DB connection in every function call, 
is there any shared connection that I can use to connect to my DB? Or, how can 
I make a shared DB connection that lives as long as the Geoserver application 
lives?

Regards,
Nanaso
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to