I already had this problem in my Application
it there possibility of forgetting to it closed problem of configuration of Oracle
forget the brocker close for your application
problem of configuration of Oracle number off statement open default is very limited but you can change this !
Thierry Hanot wrote:
Hello All There is very Weird problem on the PersistenceBroker :
- Allocate a new Broker - Get something on it ( iterator by query or identity ... )
- Let the GC free the broker - Request a new broker with the same PBKey - Make the same request ** an Exception is throw Socket Close exception
Using latest Oracle 9i driver for 1.4 and thin driver OJB RC05
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl
JRE 1.4.2.02
Is Somebody can help me .
THX
Thierry
Here is my test case
WeakReference ref = null;
PBKey key =
PersistenceBrokerFactory.defaultPersistenceBroker().getPBKey();
PersistenceBroker broker =
PersistenceBrokerFactory.createPersistenceBroker(key);
// GET SOMETHING Query q =
QueryFactory.newQuery(
DbObjectFactory.instance().getTwtzonesetsClass(),
(Criteria) null);
broker.getObjectByQuery(q);
// GET IS DONE
// ENABLE GC FOR RELEASING PB
// if a broker.close() is done , the test is working fine .
// KEEP A REF FOR BEING SUR OF PB RELEASE BY GC ref = new WeakReference(broker);
broker = null; System.gc(); System.gc(); System.gc(); Thread.sleep(1000); System.gc(); System.gc(); System.gc(); Thread.sleep(1000); Object o = ref.get(); // NORMALLY THE BROKER IS RELEASE REF IS NULL assertTrue(o == null); // RETRIEVE A NEW BROKER broker = PersistenceBrokerFactory.createPersistenceBroker(key); q = QueryFactory.newQuery( DbObjectFactory.instance().getTwtzonesetsClass(), (Criteria) null);
// HERE AN EXCEPTION IS THROW : Socket Close exception broker.getObjectByQuery(q);
-- *Reda BENZAIR** *Software Analyst
*** *Phone: +33 (0)1 4996 6324 Fax: +33 (0)1 4996 6405 Mobile: +33 (0)6 6240 6192 [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
