Hi Thomas,
I trace the problem to the array temporaryStateListeners getting really
huge ( more than 300000 entries). This array is populated by the
creation of org.apache.ojb.broker.accesslayer.RsIterator which register
itself with PersistenceBrokerAbstractImpl.addListener() and never call
removeListener().
yep, RsIterator add itself as listener to be able to close used
resources (e.g ResultSet) on close of the used PB instance. This is
needed when a user doesn't do a "full iteration" on the ResultSet. In
this case the used resources still open and ready for use, but on
PB.close() it's safe to close all used resources.
In PersistenceBrokerAbstractImpl, there is permanent and temporary
listeners; maybe the temporary listeners must be deleted at the end of
fireBrokerEvent() or something like that?
The temporary listener will be deleted at PB.close().
By the way, why permanent and
temporary ?
We use an PB-pool, so it's not guaranteed that always the same PB
instances will be returned. You have to add the listener to each PB
instance in the pool and to each new created PB instance --> permanent
PB-listener.
But this could cause bad performance, so many times it's sufficient to
add the listener only to the current used PB instance and OJB automatic
remove this listener on PB.close() --> temporary listener.
Anyway, I use `brute force' by calling removeAllListeners() after every
1000 iterations. And now, performances are back to normal.
If you always lookup a new PB instance at begin and close it at the end
of one each iteration you will see the same effect.
I will have a look in RsIterator to optimize the handling of the
listener. If the user iterate the whole ResultSet then the RsIterator
clean up resources by itself (calling #releaseDbResources()). In this
case the resource listener can be removed from the PB instance.
Currently this is not happen.
regards,
Armin
Thank you for your time,
Henri
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]