Subject | Problem with FBManagedConnection |
---|---|
Author | patcom123 |
Post date | 2002-02-16T18:38:05Z |
After much debugging and hair pulling, i think i have found a bug
with the FBManagedConnection and ManagedConnectionPool classes.
Unfortunately, i haven't found a solution as i'm still trying to get
to grips with how all the connection management stuff fits together.
The problem occurs when you use get a connection a number of times
and then try to get a number of simultaneous connections - which are
the same object and not distinct as should be?
I've traced the problem to the ConnectionEventListeners. One is
created everytime a connection is allocated, but it is never removed
upon releasing a connection. This means that in the notify function
of FBManagedCOnnection the number of times the loop which checks the
event listeners and dispatches events increases every time a
connection is allocated. This results in multiple copies of the same
connection being added to the connection pool.
This seems to be a bug unless i'm misunderstanding how things work?
It would seem sensible to remove a connection listener whenever a
connection is closed/error occurred in the while loop in notify? But
i'm not sure if this would affect other things or there is a better
place to stick it?
Any suggestions
JOHN
with the FBManagedConnection and ManagedConnectionPool classes.
Unfortunately, i haven't found a solution as i'm still trying to get
to grips with how all the connection management stuff fits together.
The problem occurs when you use get a connection a number of times
and then try to get a number of simultaneous connections - which are
the same object and not distinct as should be?
I've traced the problem to the ConnectionEventListeners. One is
created everytime a connection is allocated, but it is never removed
upon releasing a connection. This means that in the notify function
of FBManagedCOnnection the number of times the loop which checks the
event listeners and dispatches events increases every time a
connection is allocated. This results in multiple copies of the same
connection being added to the connection pool.
This seems to be a bug unless i'm misunderstanding how things work?
It would seem sensible to remove a connection listener whenever a
connection is closed/error occurred in the while loop in notify? But
i'm not sure if this would affect other things or there is a better
place to stick it?
Any suggestions
JOHN