[prev in list] [next in list] [prev in thread] [next in thread]
List: ojb-user
Subject: Re: Broker-DB Connection relation
From: Armin Waibel <arminw () apache ! org>
Date: 2004-10-27 14:26:01
Message-ID: 417FAFF9.2020006 () apache ! org
[Download RAW message or body]
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: 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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic