views:

37

answers:

2

Hello, it's really the first time for me to post.

I'am encountering a problem with my Web Apps and cannot find any answers on the web.

  • My problem is that i have a Java Web App that works on parallel with tomcat and apache using mod_jk.

  • Everything works fine, but after one day of running in tomcat, the Ajax request i do with Jquery dosn't come back with the data. I'm using SQL Base (phpMyAdmin).

  • I'm sending a request to the servlet in charge of the sql using Jquery Ajax but i never get the response. Wierd thing is that it works for a day and then stop the next one (i must than reload my WebApps to make it work again).

Could you gentle developpers give me a hint or two please ? :)

A: 

Have you looked at any error messages in the log files? Especially, do you know if the corresponding Servlet gets called at all, or is the request blocked by apache / tomcat?

inflagranti
A: 

I think whenever you are opening the connection to take data from database then probably you are not closing those connections.And every time your application is creating new connection with database without closing old one.As sql has limited number of connections so after one day or after some time your application is not able to connect with your database.So you are not getting data from database. And when you are reloading your application that time you are restarting tomcat so that time your all connections with database are being closed.So next time again you are able get data from database. So check whether you are closing database connections properly after every transaction or not.Might be this is your problem.

Rupeshit
I thought of that, but the wierd thing is that the sql request work when i do them out of ajax request (for example i am able to log with password and name). Do sql has separate limited connection for ajax and normal request ?I will try the fix i did and come back tomorrow if the close connection didn t fix it. Thank you for your help :)
Clement
@Clement Make sure you close all your connections in a finally block
Romain Hippeau