• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DB Connectoin Pool

 
Jotnarta Jot
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I am developing a simple JEE web application, using MySQL database and JBoss AS on Eclipse IDE. I did create the connection pool parameter and I connected successfully to the database using connection parameters through ds-mysql.xml file in JBoss AS.

My question is, do I need to create a connection class as a skeleton, and pass this connection to other classes or pages to create sql Statement class? or does the connection pooling mechanism is in charge of manageing all the opended connections through the web application?

Please help, and thank you in advance

jotnarta
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each time you ask for a connection from the connection pool, you are given an available connection. If the same thread (in a single request) asks for connections in multiple places, each will be a different connection. That is a good way to run out of connections very quickly and a good way to really confuse things because each connection handles its own database transaction. It is usually better to get a connection once, per request, and use only that one connection for all database work.
 
vikash mishra
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you please tell me, where you have done the setting for the connection pooling? Weathor it was done inside the mysql-ds.xml or jboss-service.xml as mbean or separate hibernate-service.xml in .har file?

Let me know what property and attribute was used for setting.

Thanks in advance.
Vikash Chandra Mishra
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic