So a GeoTools.cleanup() then :-) Basically I would love to some how partition or set a checkpoint or something and cleanup; and keep on going ... Ideally I would love to do this on a Map by Map basis in uDig so when a Map is closed I can "flush" out and geotools resources it was tracking.
We *do* have the idea of a Transaction (basically keeping track of a session) ... but so many things are done using "AUTO_COMMIT". Is there any useful examples that do this sort of thing? I wish we could do a "tag and sweep" and preserve things that are still in use... Jody On 14/05/2010, at 4:26 PM, Andrea Aime wrote: > Jody Garnett ha scritto: >> Thinking about that; I don't see a problem but kind of wish the >> shutdown was a bit more fine grained then that (ie datastore dispose >> cleaning up everything it is responsible for). >> I do like the idea of having the shutdown hook and us using it to >> catch leaks. > > Hmmm... ok, shutdown() is probably a misnomer. > > The method I have in mind has nothing to do with shutting down GeoTools > in a desktop or command line application: for that use case the > user already has the explicit close methods for any resource it grabs > (datastores, iterators, coverage readers and whatnot) and for > every thread GeoTools creates there are no problems either > because they are daemon threads (i.e., they don't prevent the > JVM from being shut down). > > However, to release a web application being undeployed there is much > more to do. > Those daemon threads have to be manually stopped, otherwise they > will keep the classloader up. > All the custom JAI readers, stream, operations and whatnot have > to be un-registered. > All the JDBC drivers loaded by the datastores have to be unregistered > as well. > > All of the above has in common one thing: you have no explicit way > to locate and properly close/unregister any of the above because > they all are implementation details of one or the other subsystem > (99% of the issues come from referencing and coverage subsystems > actually). > > So this "shutdown" method is not about closing datastores, or whatever > you have that explicitly and clearly gives you resource handling methods. > It's J2EE specific, and should handle all those nitty gritty details > that are spread out thought the library and that prevent a proper > undeploy of a web application. > > Shall we call it GeoTools.undeploy()? onWebApplicationUnload()? > > Cheers > Andrea > > > -- > Andrea Aime > OpenGeo - http://opengeo.org > Expert service straight from the developers. ------------------------------------------------------------------------------ _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel