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.  [ 4 posts ] 
Author Message
 Post subject: c3p0 parameters for standalone application
PostPosted: Tue May 22, 2007 10:00 am 
Beginner
Beginner

Joined: Thu Jan 04, 2007 5:44 am
Posts: 26
Location: Innsbruck - Sivas(TR) - Bregenz
Hi...
i use hibernate with
- java 5
- mysql 4 (local network server or vpn which is little bit slower) on windows 2005 Server
- rcp (standalone application)
- 5 or max 20 Users
- on windows xp clients

which is the best way to configure my c3p parameters i use this
Code:
      <property name="c3p0.acquire_increment">1</property>
      <property name="c3p0.idle_test_period">100</property>
      <property name="c3p0.max_size">100</property>
      <property name="c3p0.max_statements">0</property>
      <property name="c3p0.min_size">10</property>
      <property name="c3p0.timeout">100</property>


but sometimes when i connect through vpn over the internet (slow) i get some warnings with something about the connection pool..

thats my complete hibernate cfg xml without mapping things..


Code:
      <property name="connection.username">****</property>
      <property name="connection.url">jdbc:mysql://localhost/192.168.*****?autoReconnect=true</property>
      <property name="dialect">
         org.hibernate.dialect.MySQLMyISAMDialect
      </property>
      <property name="myeclipse.connection.profile">
         dbname
      </property>
      <property name="connection.password">****</property>
      <property name="connection.driver_class">
         com.mysql.jdbc.Driver
      </property>
      <property name="show_sql">true</property>
      <property name="hibernate.cache.use_query_cache">true</property>
      <property name="hibernate.cache.use_second_level_cache">
         true
      </property>
      <property name="hibernate.cache.provider_class">
         org.hibernate.cache.EhCacheProvider
      </property>
      
      
      <!-- configuration pool via c3p0-->
      
      <property name="c3p0.acquire_increment">1</property>
      <property name="c3p0.idle_test_period">100</property>
      <property name="c3p0.max_size">100</property>
      <property name="c3p0.max_statements">0</property>
      <property name="c3p0.min_size">10</property>
      <property name="c3p0.timeout">100</property>

      <!-- seconds -->    



thank you for tipps for configuration...


Top
 Profile  
 
 Post subject: Re: c3p0 parameters for standalone application
PostPosted: Tue May 22, 2007 4:38 pm 
Beginner
Beginner

Joined: Mon May 21, 2007 5:22 pm
Posts: 27
Location: Salt Lake City
[quote="mican"]Hi...
i use hibernate with
- java 5
- mysql 4 (local network server or vpn which is little bit slower) on windows 2005 Server
- rcp (standalone application)
- 5 or max 20 Users
- on windows xp clients

which is the best way to configure my c3p parameters i use this
[code]
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">100</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property> [/code]

but sometimes when i connect through vpn over the internet (slow) i get some warnings with something about the connection pool..

thats my complete hibernate cfg xml without mapping things..


[code] <property name="connection.username">****</property>
<property name="connection.url">jdbc:mysql://localhost/192.168.*****?autoReconnect=true</property>
<property name="dialect">
org.hibernate.dialect.MySQLMyISAMDialect
</property>
<property name="myeclipse.connection.profile">
dbname
</property>
<property name="connection.password">****</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="show_sql">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.use_second_level_cache">
true
</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</property>


<!-- configuration pool via c3p0-->

<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.idle_test_period">100</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.max_statements">0</property>
<property name="c3p0.min_size">10</property>
<property name="c3p0.timeout">100</property>

<!-- seconds --> [/code]


thank you for tipps for configuration...[/quote]


Hi,

If you are using the network resource so you need to change in configuration of the c3p0.

increase the timeout of c3p0.
acquire_increment > 3
max_statement > 0 for better perfomance otherwise no caching will happen.

If problem not solved, pls do let me know.

Thanks
Rahul


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 3:26 am 
Beginner
Beginner

Joined: Thu Jan 04, 2007 5:44 am
Posts: 26
Location: Innsbruck - Sivas(TR) - Bregenz
thank you.. for your answer..

some questions:

- what means acquire_increment value?
- what means max_statements?
- what are good values for this.. on what depends the values ?

thank you


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 12:48 pm 
Beginner
Beginner

Joined: Mon May 21, 2007 5:22 pm
Posts: 27
Location: Salt Lake City
Acquire Increment - Determines how many connections at a time c3p0 will try to acquire when the pool is exhausted.

Max Statement - Represent the c3p0 global prepared statement cache. maxStatementPerCOnnection will tell local prepared statement caching, with per connection basis.

Values are depends on the your requirement.
maxStatement - default (0)
maxPreparedStatement - default(0)
acquireIncrement - default(3)

maxStatement - # prepared statement * maxPoolSize
maxPreparedStatement - # prepared statement + 20 (I think this will be good enough configuration)
acquireIncrement < maxPoolSize (Otherwise causes problem)

You need to set minPoolSize and maxPoolSize based on your requirement and above parameter settings.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.