Hi friends,
I am new in hibernate. I read your c3p0 pool configuration related post on
viewtopic.php?t=934779http://www.mchange.com/projects/c3p0/index.htmlI create my session factory in HibernateUtil class using
sessionFactory = config.configure().buildSessionFactory(); in java.
My hibernate.cfg.xml file
<hibernate-configuration>
<session-factory>
<property name="hibernate.c3p0.min_size">1</property>
<property name="hibernate.c3p0.max_size">5</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.timeout">5000</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>
<mapping resource="/usermanagement/usermanagement.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I set some other property like Driver URL,Driver name using Configuration class
config.setProperty("hibernate.connection.driver_class","net.sourceforge.jtds.jdbc.Driver");
config.setProperty("hibernate.connection.url","jdbc:jtds:sqlserver://192.168.5.216:1433/USERDB");
config.setProperty("hibernate.connection.username", "abhinandan");
config.setProperty("hibernate.connection.password", "abhinandan");
I am using c3p0-0.9.1.2.jar for connection pool.
Now Problem is that when i use jtds-1.2.jar everything works fine.
But when i use jtds-1.2.4.jar i get following exception.
Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronous
Runner$PoolThread-#0" java.lang.NoClassDefFoundError: java/sql/NClob
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getMethod0(Class.java:2642)
at java.lang.Class.getMethod0(Class.java:2651)
at java.lang.Class.getMethod(Class.java:1579)
at com.mchange.v2.c3p0.impl.C3P0ImplUtils.supportsMethod(C3P0ImplUtils.java:309)
at com.mchange.v2.c3p0.impl.NewPooledConnection.<init>(NewPooledConnection.java:104)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:198)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
java.lang.NoClassDefFoundError: java/sql/NClob
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
at java.lang.Class.getMethod0(Class.java:2642)
at java.lang.Class.getMethod0(Class.java:2651)
at java.lang.Class.getMethod(Class.java:1579)
at com.mchange.v2.c3p0.impl.C3P0ImplUtils.supportsMethod(C3P0ImplUtils.java:309)
at com.mchange.v2.c3p0.impl.NewPooledConnection.<init>(NewPooledConnection.java:104)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:198)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)Whether i set some wrong property in xml file or something else.
Thanks in advance.
--
Thanks & Regards ,
Abhinandan Barve