Hi Vikram,

Vikram Rai wrote:

Hi all,

Had a very basic question with respect to the working of OJB. I know that a broker is a wrapper around a DB connection. Question is whenever i do a broker.close() does it automatically mean that a connection.close() also happens. We have a OJB-powered production system running, and we seem to be encountering lot of performance probelms. Everyday the system crashes as it hits the app-server maximum DB connection count.

sorry, seems that something wrong with connection handling


We did a total code walk-
through to check if we have missed out any borker.close() calls, but that doesn't seem to be the case.

ok, then the problem rely on the connection handling. This is done by ConnectionManager and ConnectionFactory.



So i really have a doubt if a broker.close() corresponds to a connection.close(). Or is there something to explicitly close and release all DB connections..??


The behavior base on the used ConnectionFactory http://db.apache.org/ojb/docu/guides/connection.html#ConnectionFactory

On the PB.close() call the used PB instance do a connection release on the ConnectionManager, the ConnectionManager pass the used connection to the ConnectionFactory#releaseConnection(...) method, so it depends on the used ConnectionFactory implementation what to do with the connection.
Some implementations only return the used connection to a pool for reuse and never close the connection (e.g. ConnectionFactoryPooledImpl), other do close the used connection (ConnectionFactoryNotPooledImpl).
If you use DataSource to lookup a connection, then OJB always do a real Connection.close() on the used ConnectionHandle instance.


Could you describe how you use OJB:
managed environment?
dataSource?
which ConnectionFactory?


regards, Armin


Thanks,

Vikram.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to