[EMAIL PROTECTED] wrote:
> Heh, my friend, this is were you (and me) are wrong. Due to the scary
> behaviour of FeatureListenerManager, a FeatureSource lives as long as its
> datastore once a listener is attached to it. Don't believe me?
> Look at the following code, and bear in my that we have on 
> FeatureListenerManager
> per data store (it's in every datastore because it's handled in 
> AbstractDataStore):
Remind me never to make an abstract mega class in the future ;-)
> as you can see, once the featuresource enters the listenermap, there's 
> no way to
> get it out. What's worse, FeatureSource has no method to "close" it, 
> so in fact there
> would be no good place to perform house cleaning.
I had intended FeatureSource to be "virtual" but event handling is 
making that little dream rather bust... thinking.
> Now, I'd like suggestions... I see there's some code in the listener 
> that asks
> for a centralized management, but if we don't have housekeeing too, 
> there's not
> wonder things like geoserver will bomb after a while... (that's not to 
> say this
> is the only leak around, btw).
We need that center, so two feature sources on the same transaction can 
share events (and also
grab events from changes to AUTO_COMMIT) ....

The real relationship here is listening to events against anything with 
that typeName and Transaction, so that
key we used needs to be changed for step number one. And ensure that 
Transaction.close actually cleans out events
associated with that transaction...

I would not mind seeing a close method, but need to be careful. This 
would be the nail in the coffin of a "lite"
FeatureSource, it would formally take over for the big bad 
FeatureReader/FeatureWriter/DataStore trio.

We could also set up two phases of notification, internal notification 
from the datastore/typeName/transaction level, and then a public 
notification from the FeatureSource level.  This would agree with your 
expectations Andrea, and would more closely model a datastore that 
actually did have event notification for real.

Note apparently we could listen for events w/ PostGIS - thus far it has 
been too complicated to consider (but technically it can be done). There 
have also been some cascading WFS examples showing something similar for 
that spec.

Cheers,
Jody

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to