Re: Brokers leak

2006-04-20 Thread Jon_French
Here's one brute force idea:

Put a javax.servlet.Filter across every URL (/*) of your application. 
Then check for an unclosed broker after calling FilterChain.doFilter(...) 
like this:

 public void doFilter(
ServletRequest aRequest,
ServletResponse aResponse,
FilterChain aChain)
throws IOException, ServletException {

aChain.doFilter(aRequest, aResponse);

/* Check for unclosed broker and log url path here!! */
 }

Jon French
Programmer
ECOS Development Team
[EMAIL PROTECTED]
970-226-9290

Fort Collins Science Center
US Geological Survey
2150 Centre Ave, Building C
Fort Collins, CO 80526-8116



Bruno CROS [EMAIL PROTECTED] 
04/19/2006 03:06 PM
Please respond to
OJB Users List ojb-user@db.apache.org


To
OJB Users List ojb-user@db.apache.org
cc

Subject
Brokers leak






Hi all,

 I experienced  brokers leaks. I checked all the open / close broker 
methods
and the leaks still remains. ODMG transaction have been checked too.

 Those leaks result in PersistentBroker I/O Exception, freezing 
application.

 I would be very happy to known which methods take my brokers without give
them back.
 Is there a simple way to known from where they are lost?
 Can P6Spy help ?


 What are the main reasons to have a broker leak ?
 I suspect unfinished Query iterations : what is the clean way to end an
iteration before the end of the query iteration ? persistentBroker.close()
does ?
 I suspect checkpoint() : but if i  well guess, it's only a tx.commit() 
and
a re-tx.begin() , so ...
 I suspect brokers can't be closed in some case, even when the close() is 
in
finally code. Is that possible ?! e.g. when returning a value ?
 I suspect jsp iteration. We tried to iterate only java collections in the
jsp, but it still remains query iteration inside. May be those
iterations can take brokers automatically, but can't close them? So, is
there a setting of brokers pool to avoid this? Documentation is short.

Is there a chance to have the 1.0.5 in current month ?

Thanks for all your ideas.

Using OJB 1.0.4, oracle 10g, QueriesByCriteria, ReportQueries and ODMG
transactions.



Re: Brokers leak

2006-04-20 Thread Bruno CROS
why not, but how i known that pool have unclosed brokers?

I thought about  wrap all my broker usages to register open and close
operations.

 But it will be so great to check directly inside broker pool, all the too
old given brokers. Broker older than 2 minutes would be a good indication.
If i have registered it, it will be easy to know which methods call it.
Unfortunately, i couldn't find where i can read broker pool status and last
usage broker timestamp.

Asking myself :
How can an iteration given by broker.getIteratorByQuery(q) can be used
outside the method without opening a db connection ?

and how to acces to low level pool implementation?

Thanks.

Regards






On 4/20/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Here's one brute force idea:

 Put a javax.servlet.Filter across every URL (/*) of your application.
 Then check for an unclosed broker after calling FilterChain.doFilter(...)
 like this:

 public void doFilter(
ServletRequest aRequest,
ServletResponse aResponse,
FilterChain aChain)
throws IOException, ServletException {

aChain.doFilter(aRequest, aResponse);

/* Check for unclosed broker and log url path here!! */
 }

 Jon French
 Programmer
 ECOS Development Team
 [EMAIL PROTECTED]
 970-226-9290

 Fort Collins Science Center
 US Geological Survey
 2150 Centre Ave, Building C
 Fort Collins, CO 80526-8116



 Bruno CROS [EMAIL PROTECTED]
 04/19/2006 03:06 PM
 Please respond to
 OJB Users List ojb-user@db.apache.org


 To
 OJB Users List ojb-user@db.apache.org
 cc

 Subject
 Brokers leak






Hi all,

 I experienced  brokers leaks. I checked all the open / close broker
 methods
 and the leaks still remains. ODMG transaction have been checked too.

 Those leaks result in PersistentBroker I/O Exception, freezing
 application.

 I would be very happy to known which methods take my brokers without give
 them back.
 Is there a simple way to known from where they are lost?
 Can P6Spy help ?


 What are the main reasons to have a broker leak ?
 I suspect unfinished Query iterations : what is the clean way to end an
 iteration before the end of the query iteration ? persistentBroker.close()
 does ?
 I suspect checkpoint() : but if i  well guess, it's only a tx.commit()
 and
 a re-tx.begin() , so ...
 I suspect brokers can't be closed in some case, even when the close() is
 in
 finally code. Is that possible ?! e.g. when returning a value ?
 I suspect jsp iteration. We tried to iterate only java collections in the
 jsp, but it still remains query iteration inside. May be those
 iterations can take brokers automatically, but can't close them? So, is
 there a setting of brokers pool to avoid this? Documentation is short.

 Is there a chance to have the 1.0.5 in current month ?

 Thanks for all your ideas.

 Using OJB 1.0.4, oracle 10g, QueriesByCriteria, ReportQueries and ODMG
 transactions.