i have deployed tomcat 5.5 in our sun solaris server and many applicaton are running on it which connects to 8-10 different different database . applications are running fine but if any of my database goes down then my whole tomcat server goes also down after some time and no application runs at that time.
i have put maxThreads to 150 in my server.xml file. is it right to put -1 as maxThreads ?
or there is any other solution to keep my tomcat running fine ??
There is absolutely no reason why Tomcat should go down when the database goes down. Applications may fail, and if they're poorly written, they may fail badly, but the Tomcat server doesn't have any database logic directly wired into it. While it does support connection pools, the actual pooling mechanism is simply constructed and located by Tomcat as a generic module, not actively controlled by it.
From the sound of it, what you're describing is a situation where there are a lot of database connections and when the DB server goes down, they all hang until they time out. But before you go tweaking Tomcat, you should be asking why there are so many requests active at the same time and if there isn't a smarter way to be making requests. 150 requests at a single instant seems a bit much for most apps unless you're running a really heavy load.
A database request requires more than just Tomcat resources. Each one is typically going to consume a pair of network sockets as well and they, too are limited. In fact, I've seen situations where, thanks to poor error recovery, the OS ran out of sockets and the whole machine ended up being rebooted once every few days.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
Do you mean that the Tomcat process aborts and is no longer running - OR - that Tomcat stops responding but still shows as a running process. If it shows as a running process, how much CPU time is it using?
I think Tim's comment is on the right track and poor error recovery has left all your threads tied up.