wood burning stoves 2.0*
The moose likes Performance and the fly likes Connection... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Connection..." Watch "Connection..." New topic
Author

Connection...

Zeina Afif
Greenhorn

Joined: Jul 19, 2001
Posts: 22
Our office is new in implementing J2E technology. We are set up with JRun and ms sql server. The db admin was horrifed when he opened the sql server log and saw all the connections by one of my applications.
Basically, the site queries the db almost at every page, to collect, display the different info. So everytime the user browses a page, data is being pulled from sql.
Am I doing anything wrong? I thought that everytime I connect, I should close the connection.
james edwin
Ranch Hand

Joined: Nov 22, 2001
Posts: 393
hi Zeina Afif ,
What i will suggest here is to store everything in application level,so that u donot have to go to Database again and again.
This is much better solution.Instead of getting information on each page from database.Store in APP level.
See if this fits in your problem.

Thanks


Regards,
James
Graeme Brown
Ranch Hand

Joined: Oct 13, 2000
Posts: 193
Setting up or tearing down a connection to a database is a fairly heavyweight process. You should do this as little as possible by caching connections.
Of course if you use a JDBC2 Datasource this will be done for you.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connection...