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 Vikram Rai <rv...@merindus.com> on 2004/11/05 15:03:26 UTC

Broker - DB Connection relation

Thanks Armin for the response.

Our setup uses : 

--ConnectionFactoryNotPooledImpl
--SunOne appserver 7.0 update 5 with a connection pool defined. OJB accesses 
this as a JNDI datasource. So pooling is done be app-server.
--Oracle 8i DB.

So we are not using any pooling mechanisms of OJB. We let the app-server 
maintain the pool and OJB obtains connection from the pool.

We noticed that under normal usage, the connections are used and released back 
to the pool normally. But under heavy usage, when the connection-limit is hit
(our limit is set at 32), we see that the application becomes unresponsive as 
the connections are never released even much beyond the timeout period set in 
the app-server connection pool.So we explored the possibilty of SunOne app-
server having any connection-release bugs. But that doesn't seem to be the 
case. It is in this context that we came across the below thread which speaks 
about some concurreny problem under heavy server load.

http://article.gmane.org/gmane.comp.jakarta.ojb.user/15436/match=server+load+th
read+deadlock

Does some deadlock occur during heavy server load causing all the connections 
to be tied up ??Could this be the issue.

Thanks

Vikram.


 

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


Re: Broker - DB Connection relation

Posted by Armin Waibel <ar...@apache.org>.
Hi Vikram,

 > Does some deadlock occur during heavy server load causing all the 
connections
 > to be tied up ??Could this be the issue.

Which sequence manager implementation do you use? There could be a issue 
when using SequenceManagerHighLowImpl see doc's under limitations:
http://db.apache.org/ojb/docu/guides/sequencemanager.html#High%2FLow+sequence+manager

If your appServer block the connection-pool when the limit was reached, 
the same issue could be happen.

regards,
Armin


Vikram Rai wrote:

> Thanks Armin for the response.
> 
> Our setup uses : 
> 
> --ConnectionFactoryNotPooledImpl
> --SunOne appserver 7.0 update 5 with a connection pool defined. OJB accesses 
> this as a JNDI datasource. So pooling is done be app-server.
> --Oracle 8i DB.
> 
> So we are not using any pooling mechanisms of OJB. We let the app-server 
> maintain the pool and OJB obtains connection from the pool.
> 
> We noticed that under normal usage, the connections are used and released back 
> to the pool normally. But under heavy usage, when the connection-limit is hit
> (our limit is set at 32), we see that the application becomes unresponsive as 
> the connections are never released even much beyond the timeout period set in 
> the app-server connection pool.So we explored the possibilty of SunOne app-
> server having any connection-release bugs. But that doesn't seem to be the 
> case. It is in this context that we came across the below thread which speaks 
> about some concurreny problem under heavy server load.
> 
> http://article.gmane.org/gmane.comp.jakarta.ojb.user/15436/match=server+load+th
> read+deadlock
> 
> Does some deadlock occur during heavy server load causing all the connections 
> to be tied up ??Could this be the issue.
> 
> Thanks
> 
> Vikram.
> 
> 
>  
> 
> 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