Hi,
I'm using geotools to connect to an ArcSDE Database. I reuse a single
instance of the Datastore created by the corresponding factory:
ArcSDEDataStoreFactory factory = new ArcSDEDataStoreFactory();
DataStore store = factory.createDataStore(params);
Later I use this store to read data like in this debug method:
private void debug(DataStore store) throws IOException, CQLException {
String strassenkennziffer = "3162";
String hausnummer = "150";
FeatureSource<SimpleFeatureType, SimpleFeature> s = store
.getFeatureSource("GIS.ADDRESS");
Filter filter = CQL.toFilter("STRASSENKENNZIFFER == '"
+ strassenkennziffer + "' AND HAUSNUMMER == '" +
hausnummer
+ "'");
FeatureCollection<SimpleFeatureType, SimpleFeature> fc = s
.getFeatures(filter);
if (fc.size() != 1) {
log("Not exactly one address found");
return;
}
SimpleFeature adresse = fc.iterator().next();
Object oAref = adresse.getDefaultGeometry();
if (!(oAref instanceof Point)) {
log("adrdess is not a point");
return;
}
Point adressPoint = (Point) oAref;
log("Coordinates of adress: X:" + adressPoint.getX() + " Y:"
+ adressPoint.getY());
}
This works fine, but only for 6 successive calls of the debug method, in
the 7th call I receive the following exception:
19.11.2010 11:22:05 org.geotools.arcsde.session.SessionPool getSession
WARNUNG: Out of connections: Timeout waiting for idle object. Config:
ArcSDEConnectionConfig[server=nyx, port=5151, database=null, user=sde,
minConnections=2, maxConnections=6, timeout=500]
java.lang.RuntimeException: Session pool exhausted
at
org.geotools.arcsde.data.ArcSDEDataStore.getSession(ArcSDEDataStore.java
:179)
at
org.geotools.arcsde.data.ArcSdeFeatureSource.getSession(ArcSdeFeatureSou
rce.java:248)
at
org.geotools.arcsde.data.ArcSdeFeatureSource.getCount(ArcSdeFeatureSourc
e.java:215)
at
org.geotools.arcsde.data.ArcSdeFeatureCollection.getCount(ArcSdeFeatureC
ollection.java:104)
at
org.geotools.data.store.DataFeatureCollection.size(DataFeatureCollection
.java:265)
at
de.gevas.geotools.konverter.feuerwehr.TestGui.debug(TestGui.java:302)
Do I have to release something?
Tanks for help!
Stefan
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users