[jboss-user] [JCA/JBoss] - config hibernate->jboss connection pooling

mikedanese do-not-reply at jboss.com
Fri Dec 1 14:39:37 EST 2006


on Jboss4.04 hibernate3

followed howto's and (thought) I have setup jboss-conn pooling. However, server.log emits "not for production use"?? what pooling am I using? How can I tell hibernate to use jboss pooling?

11:18:37,500 INFO  [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
11:18:37,765 INFO  [DriverManagerConnectionProvider] Hibernate connection pool size: 20
11:18:37,765 INFO  [DriverManagerConnectionProvider] autocommit mode: false
11:18:37,765 INFO  [DriverManagerConnectionProvider] using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/alertnet2




<hibernate-configuration>
    <session-factory>
        com.mysql.jdbc.Driver 
        jdbc:mysql://localhost/alertnet2 
        <property name="hibernate.connection.username


<jboss-web>
  <context-root>/</context-root>
  <resource-ref>
    <res-ref-name>jdbc/mySQL</res-ref-name>
    <jndi-name>java:/jdbc/mySQL</jndi-name>
    <res-type>javax.sql.DataSource</res-type>
  </resource-ref>
  </jboss-web>

mysql-ds.xml


  <local-tx-datasource>
    <jndi-name>jdbc/mySQL</jndi-name>
    <connection-url>jdbc:mysql://localhost/alertnet2</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>capuser</user-name>
    capuser
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <!-- intent: close pooled connections sitting idle for 30 minutes   -->
    <idle-timeout-minutes>30</idle-timeout-minutes>
    <!-- should only be used on drivers after 3.22.1 with "ping" support -->
    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
    <!-- sql to call when connection is created       -->
    <new-connection-sql>Select 1 from USER</new-connection-sql>
    <!-- sql to call on an existing pooled connection when it is obtained from pool 
      - MySQLValidConnectionChecker is preferred for newer drivers        -->
    <check-valid-connection-sql>Select 1 from USER</check-valid-connection-sql>
    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    
       <type-mapping>mySQL</type-mapping>
    
  </local-tx-datasource>


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990541#3990541

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990541



More information about the jboss-user mailing list