This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Having A DB Connection Which Remains Opened

 
James Gordon
Ranch Hand
Posts: 106
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I'm building a web application login module.
Whenever a user login, the application would
access the database SEVERAL times to pick up
information for authentication. An average
of ~60 users would use the system.

I'm a bit worry about the data access portion.
If I would to get and close a database connection
on each login, is it better off if I just keep
a database connection which would be open
whenever the server is up, just to handle
this kind of request? Meaning I don't close it.

Connection pooling might be another way but my
argument is that I only need 1 connection
for that purpose, so pooling doesn't serve
much purpose there.

Please comment.


Thanks in advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James,
You could still use a very small connection pool. Even one with one connection. This is better than keeping the connection open because it could go stale.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic