You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Gustafson, Scott F." <SC...@saic.com> on 2003/08/11 14:54:42 UTC

Closing a broker

If I run isClosed() on a PersistenceBroker which is closed, it throws an
exception rather than just returning true, is this the sort of behavior that
is expected?


java.lang.IllegalStateException: This PersistenceBroker instance is already
closed. It's not possible to re-use closed instance.
	at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getBroker(Unknown
Source)
	at
org.apache.ojb.broker.core.PersistenceBrokerHandle.isClosed(Unknown Source)


I had just wanted to be sure that the Brokers were being returned to the
pool.

Scott Gustafson

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Closing a broker

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Scott,

----- Original Message -----
From: "Gustafson, Scott F." <SC...@saic.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, August 11, 2003 2:54 PM
Subject: Closing a broker


> If I run isClosed() on a PersistenceBroker which is closed, it throws
an
> exception rather than just returning true, is this the sort of
behavior that
> is expected?
>
ups!! No it's really the sort of behaviour we expected ;-)
Checked in a fix in CVS. Change three classes, but the
real fix is done in PersistenceBrokerHandle.

Thanks!

  Index: PersistenceBrokerHandle.java
  ===================================================================
  RCS file:
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerHa
ndle.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PersistenceBrokerHandle.java 23 Jul 2003 20:06:56 -0000 1.3
  +++ PersistenceBrokerHandle.java 11 Aug 2003 13:43:42 -0000 1.4
  @@ -19,7 +19,7 @@

       public boolean isClosed()
       {
  -        if(getBroker() == null) return true;
  +        if(getDelegate() == null) return true;
           else return super.isClosed();
       }

regards,
Armin

>
> java.lang.IllegalStateException: This PersistenceBroker instance is
already
> closed. It's not possible to re-use closed instance.
> at
>
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getBroker(Unknown
> Source)
> at
> org.apache.ojb.broker.core.PersistenceBrokerHandle.isClosed(Unknown
Source)
>
>
> I had just wanted to be sure that the Brokers were being returned to
the
> pool.
>
> Scott Gustafson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org