• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

DB Connectoin Pool

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic