aspose file tools
The moose likes JSF and the fly likes JSF Database Access Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "JSF Database Access" Watch "JSF Database Access" New topic
Author

JSF Database Access

Josh Juneau
Ranch Hand

Joined: Jun 16, 2004
Posts: 86
I have written several JSF applications which implement database access now. However, I still feel that there must be a better way to manage database connections. Currently, my technique is to create a single serializable bean which every other bean within my application will extend. I put all of my "shared" methods and such within this bean including my database connection method. This seems to work fine, but it is causing multiple connections from a single user to occur each time the application is utilized.

Is there a better method of controlling database access within my JSF applications?


Database Administrator/Application Developer
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15229

The best way to handle database connections in any web application is using a Connection Pool.
Josh Juneau
Ranch Hand

Joined: Jun 16, 2004
Posts: 86
Thanks for the response.

Yes, I agree that a connection pool is the best way to go. I am using an OracleConnectionPool Cache Manager to connect to my database. Still, even with the connection pool I am seeing multiple connections. I thought that the connection pool was supposed to alleviate this problem?

Thanks in advance for any suggestions...
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JSF Database Access
 
Similar Threads
Synchronization
287 Pre-assessment test questions - Please answer
Database Updates in EJB method
Data source connection usage during nested method calls
long post IBM.158