Looks like a mistake on our side of the fence ...  possibly in the 
isEmpty() (it should do the same thing you do at the bottom with 
checking the iterator.hasNext()... perhaps it did not clean up?

The next step would be to run through it with a debugger.

Jody
Linares wrote:
> Hi gt2 user. It's my first post !
>
> I've a strange warning from QueryData when i make two or much simple 
> request.
> please look at simple code bellow:
>
> 12 avr. 2007 16:11:46 org.geotools.data.jdbc.QueryData finalize
> GRAVE: There's code leaving readers, writers or iterators unclosed (you 
> got an unclosed QueryData object, which is usually held by a reader or a 
> writer).
> Call reader/writer.close() or FeatureCollection.close(iterator) after 
> using them to ensure they do not hold state such as JDCB connections.
> QueryData was open against feature type: parcelles_polygon
>
> It's important ? how to stop this ? I think i close my iterator so what 
> is the problem ?
> Thanks.
> Please excuse my English I'm a French student.
>
>
> public class Test {
>    
>     public static Feature retrive(int id) {
>
>         FeatureIterator fi = null;
>         FeatureCollection fc = null;
>         try {
>             PostgisDataStoreFactory pdsf = new PostgisDataStoreFactory();
>             PostgisDataStore dataStore = (PostgisDataStore) pdsf
>                     .createDataStore(conect.getParamAsMap());
>
>             FeatureSource fs = 
> dataStore.getFeatureSource("parcelles_polygon");
>
>             // Create the id filter
>             FilterFactory2 ff = (FilterFactory2) CommonFactoryFinder
>                     .getFilterFactory(null);
>             Filter selectFid = 
> ff.id(Collections.singleton(ff.featureId("parcelles_polygon"
>                     + "." + id)));
>
>             // get the filtered collection
>             fc = fs.getFeatures(selectFid);
>             fi = fc.features();
>
>             //test if the feature exist
>             if ((fc == null)) {
>                 return null;
>             } else {
>                 if (fc.isEmpty()) {
>                     return null;
>                 }
>             }
>             fi = fc.features(); 
>             return fi.next();
>
>         } catch (IOException e) {
>             LOGGER.warning("DataBase not found: " + e.getLocalizedMessage()
>                     + " exit");
>             System.exit(1);
>         } finally {
>             if (fi != null)
>                 fi.close();
>             if (fc != null) {
>                 fc.close(fi);
>             }
>         }
>         return null;
>     }
>    
>    
>     public static void main(String[] args) {
>         System.out.println(retrive(123));
>         System.out.println(retrive(12));
>     }  
>    
>     //my connection manager classe
>    ConnectionDB conect = new ConnectionDB("192.168.1.30", "camgis",
>                 "5432", "admin", "fluxo");  
>
>     private static final Logger LOGGER = Logger
>             .getLogger(Test.class.toString());
> }
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geotools-gt2-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to