db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Efftinge <ld-developm...@lohndirekt.de>
Subject closing resources
Date Fri, 30 Jan 2004 08:32:50 GMT
Hi Armin,
I found the strictness in closing used resources very problematic, 
especially when using proxies.
Since proxies should be transparent (and so the fact that in OJB a proxy 
is associated to a persistencebroker)
users normally wouldn't expect an error when doing the following:
 
PersistenceBroker broker = null;
Persistent obj = null;
 try {
      broker = PersistenceBrokerFactory.createPersistenceBroker(pbKey);
      obj = broker.getObjectByIdentity(anIdentity);
 } finally {
      broker.close();
 }
 obj.getReference().getFieldVal();

I don't know if the problem occurs with references, 
collection-references or both ??

Additionally the strictness is not that strict, because the error 
doesn't occur always (only under stress?).
So it is not easy to locate problematic code sequences.
Couldn't we think about a different solution?

regards,
Sven



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


Mime
View raw message