Subject Re: Should (Could) FBStatements be held in WeakHashMap
Author Roman Rokytskyy
Robert,

> > If this is an issue (and I'm not sure why it should be), I would
> > prefer to have a DEBUG mode that tracks statements and their
> > resource consumption. By turning this flag on I could tell that
> > I'm am not properly closing resources without imposing a hit on
> > those who are using resources properly.

> Sure it's worth checking, but the implemntation is fairly simple,
> and fairly close to as cost efficient as the original, checking a
> debug flag would likely consume more cpu time than was added to the
> routine.

Replacing current set that contains hard references (we need them to
correctly release statements) with WeakHashMap should not introduce
any noticable performance degradation. The only thing I'm still
worried about is correctness of such approach, but I hardly can find
any argument against it.

Debug mode, in my opinion, should be implemented as dynamic proxy.
This would allow us to instantiate proxy only in debug mode and use
main class in normal execution mode.

Best regards,
Roman Rokytskyy