I have never implemented this before but I have read a good implementation
about what you are trying to accomplish. In chapter 9 of Java server
programming from Wrox they give a great implementation of connection pools,
which is what I think you need to do. You can get the implementation off of
their web site.
Creating a thousand connections to a database is going to be a huge resource
strain, and 10 pooled connections probably won't be enough. To have 1000
allocated connections I think would probably be slower than pooling say 80
connections. I would base the number of connections on how much time the
application actually uses the connection and how much time it spends doing
other things, to include user input. If the application uses the database
connection, on average, 15% of the time than you would only need 150
connections and a user would never have to wait for a connection, as long as
the connections are returned to the pool right when they are done with the
resource. I don't think the jvm will crash with deadlock it will just
freeze and I think if you use the model from wrox you should not have any
problems with deadlock. With 150 different resources I think that it would
have to be a pretty bad bug in order for it to reach deadlock.
I really think that poling the connections will be faster.
Zach hensley
ValueOptions, inc.
programmer Analyst
-----Original Message-----
From: Mehul Patel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 21, 2000 9:33 AM
To: [EMAIL PROTECTED]
Subject: Connection Pooling : Need suggestions
Hi all,
I am using following platforms for portal development
Database: MS SQL 7.0
Development Platform: JSP and Beans
We are expecting around about 1000 concurrent users to this portal.
Database connectivity is the crucial part for the same. We have two
options.
Option:1
We use a session level database connection. Means: every user will get a
separate database connection. They will be using this connection to access
(insert/update/delete) database.
Problems:
1) We will have 1000 database connections at a time, which will increase
server load.
2) How to close the database connection once the session level JSP (a
compiled Servlets loaded in server memory) ?
Option:2
We can have a Servlets based connection pooling, which will open a set of
connections (e.g.10 connections) while initialization. Only 10 users will
be served at a time. Rest of the users will be placed in the queue. As
soon as any of 10 connection gets free, will be given to queued users.
Problems:
1) If there is a dead lock in multi threading logic, the JVM will crash.
2) Longer response time due to queuing.
Please let me know anybody has implemented this logic.
Regards,
Mehul Patel
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets