[jboss-user] [EJB 3.0] - Database Connection Pooling?

majohnst do-not-reply at jboss.com
Mon Mar 5 12:08:27 EST 2007


Really simple question, how do I setup database connection pooling in JBoss? Is it installed by default?

I am currently using EJB3 to access a datasource defined through jboss. I am accessing the database through:


  |   <local-tx-datasource>
  |     <jndi-name>MyDS</jndi-name>
  |     <connection-url>jdbc:postgresql://localhost/mydb</connection-url>
  |         <driver-class>org.postgresql.Driver</driver-class>
  |         <user-name>username</user-name>
  |         <password></password>
  | 	<min-pool-size>5</min-pool-size>
  |     	<max-pool-size>20</max-pool-size>
  |   </local-tx-datasource> 
  | 
  | ... 
  | 
  | @PersistenceContext(unitName="myname") 
  | private EntityManager em;
  | ...
  | Object obj = em.find(MyClass.class, id)
  | 

All my code works correctly, I just want to understand how the database connections are pooled.  Is there anything else I need to change in my EJB3 to take advantage of the connection pooling?

Thanks.

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

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



More information about the jboss-user mailing list