Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

This article describes how to enable connection pooling with hibernate using c3po.

  1. Get the jars from www.sos-berlin.com/download/jobscheduler_c3po.zip
  2. Unzip the jars to scheduler_home/lib
  3. Open scheduler_data/config/hibernate.cfg.cml
  4. Add the settings for c3po
  5. Restart JobScheduler
Code Block

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                         "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
 ''<hibernate-configuration>''
 '' <session-factory>''
 '' <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>''
 '' <property name="hibernate.connection.password">pwd</property>''
 '' <property name="hibernate.connection.url">jdbc:postgresql://server:5432/test</property>''
 '' <property name="hibernate.connection.username">user</property>''
 '' <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>''
 '' <property name="hibernate.show_sql">false</property>''
 '' <property name="hibernate.connection.autocommit">false</property>''
 '' <property name="hibernate.format_sql">true</property>''
 '' <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property>''
  
  '''<property name="hibernate.c3p0.min_size">5</property>'''
  '''<property name="hibernate.c3p0.max_size">20</property>'''
  '''<property name="hibernate.c3p0.timeout">300</property>'''
  '''<property name="hibernate.c3p0.max_statements">50</property>'''
  '''<property name="hibernate.c3p0.idle_test_period">3000</property>'''
 ''</session-factory>''
 ''</hibernate-configuration>''

...