-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Saurabh,
On 4/8/14, 6:22 AM, Saurabh Saraswat wrote: > Thanks for taking time to respond me. > > My updated Resource Tag is - > > <Resource name="jdbc/MaxDB" auth="Container" > type="javax.sql.DataSource" maxActive="100" maxIdle="30" > maxWait="10000" That's a lot of connections. Are you sure you need to be able to support 100 simultaneous queries? > username="usrname" password="password" > driverClassName="com.mysql.jdbc.Driver" > > url="jdbc:MySQL://localhost:3306/MaxDB?zeroDateTimeBehavior=convertToNull" > > validationQuery="Select 1" removeAbandoned="true" You should use "/* ping */ SELECT 1" as your validation query. The MySQL driver will perform a lightweight connectivity test instead of actually executing that query, which will improve performance. > removeAbandonedTimeout="1000" 1 second for abandoned timeout? That seems low. > logAbandoned="false"/> I highly recommend that you set this to "true". > I have also cross checked my code. I am closing the connection > properly in finally block. How about Statements and ResultSets? I think the MySQL driver (and db) is tolerant of sloppy resource management, but Oracle certainly isn't. > Also have set the max_connection=250 in etc/my.cnf for MySql. That just seems like a huge number. You really ought to set connection limits based upon user id. You don't want to lock-out root from your database if your web application runs away with the database... > Even now i am not getting any Exception but my Application gets > Hanged after a certain time (after Certain hits to the database > from application). Have tested pooling with different ways like > after setting - > factory="org.apache.tomcat.jdbc.pool.DataSourceFactory". > > Conclusion is that i am not able to find satisfactory solution. I agree with Daniel: you need to take some thread dumps when the application "hangs". - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTR4TZAAoJEBzwKT+lPKRY3WcP/itpZZE7WZqM9B3fSsDNFXmq 7jm6Wpzujj2pLNjUmtzKaSk44e1XgQTQ07LoxS0b3SLPpRi7yz6KbzCeQCOzQ6KE OXVj7d3plRReg5P2HaSL6FYfYDDh2ql/tKaEEnXVXOvCLI83UEnTnN2ENrsbXwEF Lx+t2mEfX00GlENqasheX6/hcDlHDiSJlccRBGbyF9cXHTF1YFLVJl4vT3R35uwm myiPTepohDAMH4zZ1s2hzQynGpUb69/dnaIopM+BE86YavfKhuNntdFhMF9kaTOQ s7A8UpyGgR4qaCH8qeHDC+brIJVtoVPTnBrcVKiU8oLFY2+K0vCN6tutBQrHTcRz HmYN638X3u6OyHY6nS+N2oEDLzZ/CLV2dntAXhEwOojiePq1mVdDDU48VUAT1ghD BS26DPquhSpedq/XgIrxmaNX69qjb5IWWD9b/0LuxoXSTriuK8Gjhyq2xDYxhoFP 5MZLf5ebUofZsw2qYVijYvy1vXLw96HruCNQMQCzis4Zo+pEt1jk+JT4gzZmrq5o fH0bvAvLriPSYR6STeJAs2/eJ8cOCoi8Vq5AF5NAq5XZGhLnQHbF0WYmHk/ZGen3 WSUhlGXYgFIK3Pf2NRGhf0cnu7gWKighhwqsNB135R7HlPeAg/RwrIcxAdckDULz FYXDKJS+U8HZdiCOoiaQ =JYNR -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org