0

I am getting above exception after server runs for couple of days and I already knows that it is a connection pooling issue. I use JBoss 5.3 and Hibernate. I have a JBoss datasource file and below hibernate file.

<hibernate-configuration>
  <session-factory>
      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
      <property name="connection.datasource">java:/DefaultDS</property>
  </session-factory>
</hibernate-configuration>

How can i integrate c3p0 with this in order to improve the connection pooling?

Datasource:

<datasources>
  <local-tx-datasource>
    <jndi-name>DefaultDS</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/xxx</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>xxx</user-name>
    <password>xxx</password>
    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <min-pool-size>15</min-pool-size>
    <max-pool-size>50</max-pool-size>
    <metadata>
       <type-mapping>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
</datasources>
Janath
  • 137
  • 9
  • Please show the configuration of your datasource (after anonymizing server/userid/password). – piet.t Oct 29 '15 at 10:01
  • What makes you think that integrating c3po will fix the problem? – user207421 Oct 30 '15 at 02:34
  • I have updated the question. Also I have found out that, Jboss 5, is 15 minutes. It looks mysql is closing the idle connection and it gives this problem. – Janath Oct 30 '15 at 02:36
  • @EJP, Since Hibernate does not having good connection pooling, I thought it first. But now it looks more into JBoss data source. How can i resolve this? – Janath Oct 30 '15 at 02:38

0 Answers0