I found a semi-good work-around for the described problem.
I installed a Thread object in the Tomcat-session, which fires a simple request to the database every 1 hour. That keeps the connection alive and mySQL will not close non-busy connections.
REMARK:
If someone has a better solution, please post this as wll.
Thanks
Klaus
------------ 8< ---------------------------------------
In my "index.jsp":
Code:
if( application.getAttribute( "wakeupDB" ) == null ){
com.dll.util.WakeupDB wk = new com.dll.util.WakeupDB();
wk.start();
application.setAttribute( "wakeupDB", wk );
}
Thread-Object:
Code:
public class WakeupDB extends Thread {
public WakeupDB() {
}
public void run(){
setPriority( MIN_PRIORITY );
try {
_BaseRootDAO.initialize();
while( ( ! isInterrupted() ) ){
Thread.sleep( 1*60*60*1000 );
String s = BaseOptionDAO.getInstance().getCurrency( "CH" );
}
System.out.println( "WakeupDB finished" );
}catch (Exception e) {
e.printStackTrace();
}
}