[Geoserver-users] ArcSDE connection pooling issues

Some more info, WMS keeps on working fine, whereas WFS-T support breaks
after a few (about 10) transactions, even after increasing the timeout to
10000.

I also get a lot of broken pipe errors:

2008-02-20 16:59:58,034 INFO [org.geotools.arcsde.pool.ArcSDEConnectionPool]
- Can't validate SeConnection, discarding it:
org.geotools.arcsde.pool.ArcSDEPooledConnection@anonymised.com
2008-02-20 16:59:58,035 INFO [org.geotools.arcsde.pool] - closing
connection: Broken pipe
2008-02-20 16:59:58,036 WARN [org.geoserver.ows] -
java.lang.IndexOutOfBoundsException
        at
java.io.ByteArrayInputStream.read(ByteArrayInputStream.java(Compiled Code))
        at java.io.DataInputStream.read(DataInputStream.java(Inlined
Compiled Code))
        at com.esri.sde.sdk.client.r$a_.a(Unknown Source)
        at com.esri.sde.sdk.client.r$a_.l(Unknown Source)
        at com.esri.sde.sdk.client.r$a_.b(Unknown Source)
        at com.esri.sde.sdk.client.r$a_.b(Unknown Source)
        at com.esri.sde.sdk.client.r.j(Unknown Source)
        at com.esri.sde.sdk.client.b.h(Unknown Source)
        at com.esri.sde.sdk.client.b.o(Unknown Source)
        at com.esri.sde.sdk.client.j.a(Unknown Source)
        at com.esri.sde.sdk.client.SeQuery.calculateTableStatistics(Unknown
Source)
        at
org.geotools.arcsde.data.ArcSDEQuery.calculateResultCount(ArcSDEQuery.java:632)
        at
org.geotools.arcsde.data.ArcSDEQuery.calculateResultCount(ArcSDEQuery.java:543)
        at
org.geotools.arcsde.data.ArcSDEDataStore.getCount(ArcSDEDataStore.java:996)
        at
org.geotools.data.AbstractFeatureSource.getCount(AbstractFeatureSource.java:310)
        at
org.geotools.data.DefaultFeatureResults.getCount(DefaultFeatureResults.java:295)
        at
org.geotools.data.store.DataFeatureCollection.size(DataFeatureCollection.java:282)
        at
org.geotools.data.crs.ForceCoordinateSystemFeatureResults.size(ForceCoordinateSystemFeatureResults.java:122)
        at org.geoserver.wfs.GetFeature.run(GetFeature.java:254)
        at
org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:108)
        at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled
Code))
        at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
        at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl

--------- Oorspronkelijk bericht --------
Van: Bart van den Eijnden OSGIS <bartvde@anonymised.com>
Naar: Gabriel Roldán <groldan@anonymised.com>,
geoserver-users@lists.sourceforge.net
<geoserver-users@lists.sourceforge.net>, Bart van den Eijnden OSGIS
<bartvde@anonymised.com>
Cc: Saul Farber <Saul.Farber@anonymised.com>
Onderwerp: Re: [Geoserver-users] ArcSDE connection pooling issues
Datum: 20/02/08 13:49

Hi Gabriel,

the OL layers are WFS layers, so Untiled. There are only 3 layers (one for
points, polygons and lines) in the application, and using OpenLayers
(Layer.WFS) new features are added.

So we don't use WMS, only WFS in this case.

I have the default value for the connection timeout, I'll try increasing

it.

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl

--------- Oorspronkelijk bericht --------
Van: Gabriel Roldán &lt;groldan@anonymised.com&gt;
Naar: geoserver-users@lists.sourceforge.net
&lt;geoserver-users@lists.sourceforge.net&gt;, Bart van den Eijnden OSGIS
&lt;bartvde@anonymised.com&gt;
Cc: Saul Farber &lt;Saul.Farber@anonymised.com&gt;
Onderwerp: Re: [Geoserver-users] ArcSDE connection pooling issues
Datum: 20/02/08 13:41

&gt; Hi Bart,
&gt;
&gt; My first thought is it may be a matter of balance bettween connection

pool

&gt; size and pool's connTimeout argument. Did you try increasing the
connTimeout
&gt; parameter in the DataStore config?
&gt;
&gt; question though: is the openlayers client requesting tiles? I've to

admit

I
&gt; never tried a tiling client over arcsde layers myself, but it would

make

&gt; sense to run out of connections depending on the ammount of tiles

being

&gt; requested at a time and the ammount of layers composing the map.
&gt; Yet its though. I've been trying Saul's massgis WMS[1] through uDig

before

&gt; replying to this message and it seems to perform well even requesting

20

&gt; layers at a time.
&gt;
&gt; May be Saul (cc'ed) can give us a couple clues about how to set up a
&gt; production geoserver backed up by arcsde?
&gt;
&gt; Saul: did you ever run into connection exhaustion issues with your

server

and,
&gt; if so, how did you solved them? is it just a matter of having a ton

of

&gt; available connections? and did you ever tried hitting it with a

tiling

&gt; client?
&gt;
&gt; cheers,
&gt;
&gt; Gabriel
&gt;
&gt; [1]Massgis WMS server:
&gt;

&amp;lt;http://giswebservices.massgis.state.ma.us/geoserver/wms?service=WMS&amp;amp;request=GetCapabilities&amp;gt;

&gt;
&gt; On Wednesday 20 February 2008 02:20:39 pm Bart van den Eijnden

(OSGIS)

wrote:
&gt; &amp;gt; Hi list,
&gt; &amp;gt;
&gt; &amp;gt; we are running into connection pooling issues (using

1.6RC2), we now

have
&gt; &amp;gt; even increased the maximum number up to 25 (coming from 8),

but still

&gt; &amp;gt; Geoserver runs out of connections after a while. There is

only 1

client
&gt; &amp;gt; (OpenLayers based) active!
&gt; &amp;gt;
&gt; &amp;gt; What could be the issue?
&gt; &amp;gt;
&gt; &amp;gt; Caused by: java.util.NoSuchElementException: Could not

aquire

&gt; &amp;gt; feature:org.geotools.data.DataSourceException: The maximun

of 25 to

&gt; &amp;gt;

org.geotools.arcsde.pool.ArcSDEConnectionConfig[dbtype=arcsde,

&gt; &amp;gt; server=geodatabase.ad.rws.nl, port=5151, instance=null,

user=DID,

&gt; &amp;gt; password=*****, minConnections=2, maxConnections=25,
connTimeOut=1000] has
&gt; &amp;gt; been reached
&gt; &amp;gt;
&gt; &amp;gt; 2008-02-20 11:17:03,298 WARN
&gt; &amp;gt; [org.geotools.arcsde.pool.ArcSDEConnectionPool] - Out of

connections:

&gt; &amp;gt; Timeout waiting for idle object
&gt; &amp;gt; java.util.NoSuchElementException: Timeout waiting for idle

object

&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPo

&gt; &amp;gt;ol.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.geotools.arcsde.pool.ArcSDEConnectionPool.getConnection(ArcSDEConnectio

&gt; &amp;gt;nPool.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.geotools.arcsde.data.ArcSDEDataStore.getFeatureWriterAppend(ArcSDEDataS

&gt; &amp;gt;tore.java:963) at
&gt; &amp;gt;

org.geotools.data.AbstractFeatureStore.addFeatures(AbstractFeatureStore.jav

&gt; &amp;gt;a:249) at
&gt; &amp;gt;

org.vfny.geoserver.global.GeoServerFeatureStore.addFeatures(GeoServerFeatur

&gt; &amp;gt;eStore.java:76) at
&gt; &amp;gt;

org.geoserver.wfs.InsertElementHandler.execute(InsertElementHandler.java:16

&gt; &amp;gt;4) at

org.geoserver.wfs.Transaction.execute(Transaction.java:328) at

&gt; &amp;gt;

org.geoserver.wfs.Transaction.transaction(Transaction.java:104) at

&gt; &amp;gt;

org.geoserver.wfs.DefaultWebFeatureService.transaction(DefaultWebFeatureSer

&gt; &amp;gt;vice.java:156) at
sun.reflect.GeneratedMethodAccessor203.invoke(Unknown
&gt; &amp;gt; Source) at
&gt; &amp;gt;

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp

&gt; &amp;gt;l.java(Compiled Code))
&gt; &amp;gt; at

java.lang.reflect.Method.invoke(Method.java(Compiled

Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Aop

&gt; &amp;gt;Utils.java:292) at
&gt; &amp;gt;

org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoin

&gt; &amp;gt;t(ReflectiveMethodInvocation.java:155) at
&gt; &amp;gt;

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflec

&gt; &amp;gt;tiveMethodInvocation.java:122) at
&gt; &amp;gt; org.geoserver.wfs.WFSLogger.invoke(WFSLogger.java:44)
&gt; &amp;gt; at
&gt; &amp;gt;

org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflec

&gt; &amp;gt;tiveMethodInvocation.java:144) at
&gt; &amp;gt;

org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopPr

&gt; &amp;gt;oxy.java:174) at $Proxy0.transaction(Unknown Source)
&gt; &amp;gt; at

sun.reflect.GeneratedMethodAccessor306.invoke(Unknown

Source)
&gt; &amp;gt; at
&gt; &amp;gt;

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp

&gt; &amp;gt;l.java(Compiled Code))
&gt; &amp;gt; at

java.lang.reflect.Method.invoke(Method.java(Compiled

Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.geoserver.security.OperationSecurityInterceptor.invoke(OperationSecurit

&gt; &amp;gt;yInterceptor.java:41) at
&gt; &amp;gt; org.geoserver.ows.Dispatcher.execute(Dispatcher.java:495) at
&gt; &amp;gt;
org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:188)
&gt; &amp;gt; at
&gt; &amp;gt;

org.springframework.web.servlet.mvc.AbstractController.handleRequest(Abstra

&gt; &amp;gt;ctController.java:139) at
&gt; &amp;gt;

org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(S

&gt; &amp;gt;impleControllerHandlerAdapter.java:44) at
&gt; &amp;gt;

org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServ

&gt; &amp;gt;let.java:684) at
&gt; &amp;gt;

org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServl

&gt; &amp;gt;et.java:625) at
&gt; &amp;gt;

org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkSe

&gt; &amp;gt;rvlet.java:392) at
&gt; &amp;gt;

org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.ja

&gt; &amp;gt;va:357) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at
&gt; &amp;gt;

javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled

Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio

&gt; &amp;gt;nFilterChain.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC

&gt; &amp;gt;hain.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacter

&gt; &amp;gt;EncodingFilter.java:108) at
&gt; &amp;gt;

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio

&gt; &amp;gt;nFilterChain.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC

&gt; &amp;gt;hain.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterC

&gt; &amp;gt;hainProxy.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecu

&gt; &amp;gt;rityInterceptor.java:107) at
&gt; &amp;gt;

org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSe

&gt; &amp;gt;curityInterceptor.java:72) at
&gt; &amp;gt;

org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterC

&gt; &amp;gt;hainProxy.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslati

&gt; &amp;gt;onFilter.java:110) at
&gt; &amp;gt;

org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterC

&gt; &amp;gt;hainProxy.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(An

&gt; &amp;gt;onymousProcessingFilter.java:125) at
&gt; &amp;gt;

org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterC

&gt; &amp;gt;hainProxy.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessi

&gt; &amp;gt;ngFilter.java:178) at
&gt; &amp;gt;

org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterC

&gt; &amp;gt;hainProxy.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(Http

&gt; &amp;gt;SessionContextIntegrationFilter.java:229) at
&gt; &amp;gt;

org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterC

&gt; &amp;gt;hainProxy.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)

&gt; &amp;gt; at
&gt; &amp;gt;

org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98

&gt; &amp;gt;) at
&gt; &amp;gt;

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio

&gt; &amp;gt;nFilterChain.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC

&gt; &amp;gt;hain.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j

&gt; &amp;gt;ava:213) at
&gt; &amp;gt;

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j

&gt; &amp;gt;ava:178) at
&gt; &amp;gt;

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12

&gt; &amp;gt;6) at
&gt; &amp;gt;

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:10

&gt; &amp;gt;5) at
&gt; &amp;gt;

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav

&gt; &amp;gt;a:107) at
&gt; &amp;gt;
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

&gt; &amp;gt; at
&gt; &amp;gt;
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
&gt; &amp;gt; at
&gt; &amp;gt;

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConn

&gt; &amp;gt;ection(Http11Protocol.java:744) at
&gt; &amp;gt;

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.ja

&gt; &amp;gt;va:527) at
&gt; &amp;gt;

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerW

&gt; &amp;gt;orkerThread.java:80) at
&gt; &amp;gt;

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja

&gt; &amp;gt;va:684) at java.lang.Thread.run(Thread.java:568)
&gt; &amp;gt; Caused by:
org.geotools.arcsde.pool.UnavailableArcSDEConnectionException:
&gt; &amp;gt; The maximun of 8 to
&gt; &amp;gt;

org.geotools.arcsde.pool.ArcSDEConnectionConfig[dbtype=arcsde,

&gt; &amp;gt; server=geodatabase.ad.rws.nl, port=5151, instance=null,

user=DID,

&gt; &amp;gt; password=*****, minConnections=2, maxConnections=8,

connTimeOut=1000]

has
&gt; &amp;gt; been reached
&gt; &amp;gt; at
&gt; &amp;gt;

org.geotools.arcsde.pool.ArcSDEConnectionPool.getConnection(ArcSDEConnectio

&gt; &amp;gt;nPool.java(Compiled Code))
&gt; &amp;gt; at
&gt; &amp;gt;

org.geotools.arcsde.data.ArcSDEDataStore.getFeatureWriterAppend(ArcSDEDataS

&gt; &amp;gt;tore.java:963) at
&gt; &amp;gt;

org.geotools.data.AbstractFeatureStore.addFeatures(AbstractFeatureStore.jav

&gt; &amp;gt;a:249) at
&gt; &amp;gt;

org.vfny.geoserver.global.GeoServerFeatureStore.addFeatures(GeoServerFeatur

&gt; &amp;gt;eStore.java:76) at
&gt; &amp;gt;

org.geoserver.wfs.InsertElementHandler.execute(InsertElementHandler.java:16

&gt; &amp;gt;4) ... 61 more
&gt; &amp;gt; 2008-02-20 11:17:03,301 DEBUG
&gt; &amp;gt; [org.geotools.arcsde.pool.ArcSDEConnectionPool] - Connection
validated,
&gt; &amp;gt; returned user DID
&gt; &amp;gt; 2008-02-20 11:17:03,301 INFO [org.geoserver.wfs] -
&gt; &amp;gt; Request: transaction
&gt; &amp;gt; handle = null
&gt; &amp;gt; service = WFS
&gt; &amp;gt; version = 1.0.0
&gt; &amp;gt; baseUrl = http://145.50.148.45:8082/geoserver/
&gt; &amp;gt; lockId = null
&gt; &amp;gt; group =
&gt; &amp;gt;

[net.opengis.wfs:insert=net.opengis.wfs.impl.InsertElementTypeImpl@anonymised.com

&gt; &amp;gt; (feature: [Feature[ id=fid-121efd4e_11831468923_-7fa3 ,

OBJECTID=null

,
&gt; &amp;gt; TITEL=null , DATUM=null , SHAPE=MULTIPOLYGON

(((135439.96200400835

&gt; &amp;gt; 421159.9247387089, 155040.01315245865 422279.9276614775,
148319.99561584712
&gt; &amp;gt; 400439.87066749, 135439.96200400835 421159.9247387089))) ]],

handle:

null,
&gt; &amp;gt; idgen: &amp;lt;unset&amp;gt;, inputFormat:

&amp;lt;unset&amp;gt;, srsName: null)]

&gt; &amp;gt; insert =

[net.opengis.wfs.impl.InsertElementTypeImpl@anonymised.com

&gt; &amp;gt; (feature: [Feature[ id=fid-121efd4e_11831468923_-7fa3 ,

OBJECTID=null

,
&gt; &amp;gt; TITEL=null , DATUM=null , SHAPE=MULTIPOLYGON

(((135439.96200400835

&gt; &amp;gt; 421159.9247387089, 155040.01315245865 422279.9276614775,
148319.99561584712
&gt; &amp;gt; 400439.87066749, 135439.96200400835 421159.9247387089))) ]],

handle:

null,
&gt; &amp;gt; idgen: &amp;lt;unset&amp;gt;, inputFormat:

&amp;lt;unset&amp;gt;, srsName: null)]

&gt; &amp;gt; update =
&gt; &amp;gt; delete =
&gt; &amp;gt; native =
&gt; &amp;gt; releaseAction = ALL
&gt; &amp;gt;
&gt; &amp;gt; TIA.
&gt; &amp;gt;
&gt; &amp;gt; Best regards,
&gt; &amp;gt; Bart
&gt; &amp;gt;
&gt; &amp;gt; --
&gt; &amp;gt; Bart van den Eijnden
&gt; &amp;gt; OSGIS, Open Source GIS
&gt; &amp;gt; http://www.osgis.nl
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
&gt; &amp;gt;
-------------------------------------------------------------------------
&gt; &amp;gt; This SF.net email is sponsored by: Microsoft
&gt; &amp;gt; Defy all challenges. Microsoft(R) Visual Studio 2008.
&gt; &amp;gt; http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
&gt; &amp;gt; _______________________________________________
&gt; &amp;gt; Geoserver-users mailing list
&gt; &amp;gt; Geoserver-users@lists.sourceforge.net
&gt; &amp;gt; https://lists.sourceforge.net/lists/listinfo/geoserver-users
&gt; &amp;gt;
&gt; &amp;gt; !DSPAM:4045,47bc2944165086491211187!
&gt;
&gt;
&gt;
&gt;