-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Doubts view quantity of connection in the pool
PostPosted: Tue Jan 13, 2009 12:45 pm 
Newbie

Joined: Tue Jan 13, 2009 11:04 am
Posts: 13
Hello,

by Hibernate is there any class (method) that can see how many connections are defined in an application disponiveis.Por example 10 connections in the pool and got 1 application connection would like to see the result of 9 active connections in the pool?

Code:

<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
         <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
         <property name="hibernate.connection.url" value="jdbc:mysql://localhost/banco"/>
         <property name="hibernate.connection.username" value="root"/>
         <property name="hibernate.connection.password" value="root"/>
         <property name="hibernate.show_sql" value="true" /> 
 
         <!-- Foi incluido para testar o Pool de Conexão  -->
         <!-- property name="hibernate.connection.pool_size " value="10" /--> 

         
         <!--  Inicio Configuração do Pool de Conexão  -->
         <!-- Número minimo de um pool de conexões  vai manter, em qualquer momento -->
         <property name="hibernate.c3p0.min_size" value="0"/>
         <!-- Número máximo de um pool de conexões  vai manter, em qualquer momento -->
         <property name="hibernate.c3p0.max_size" value="10"/>
         <!-- Segundos uma conexão pode permanecer inativa, mas não utilizadas antes de serem descartadas. Zero significa ocioso conexões nunca expiram -->
         <property name="hibernate.c3p0.timeout" value="1000"/>
         <!-- Indica que no máximo de 50 declarações irá para o cache..isso melhora a performance com Hibernate  -->
         <property name="hibernate.c3p0.max_statements" value="50"/>
         <!--Se este é um número maior que 0, c3p0 irá testar todos os ocioso, mas pooled Unchecked-out ligações, este número de segundos de cada-->
         <property name="hibernate.c3p0.idle_test_period" value="3000"/>
         <!--Determina quantas conexões em um momento c3p0 irá tentar adquirir quando o pool estiver esgotado -->
         <property name="hibernate.c3p0.acquire_increment" value="2"/>         
         <!--  Fim Configuração do Pool de Conexão  -->


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 3:51 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 8:25 am
Posts: 46
Location: Saint Petersburg, Russian Federation
That doesn't seem to be related with the hibernate at all. You can just use API of the corresponding connection pool provider to check the pool state.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.