creating threads in init for servlet (advanced)

Hello

we have a servlet ..in servlets init method we are creating new threads by calling the Timer class like this

BGMSchedul =new Timer(true);

BGM =new BackManager();

BGMSchedul.scheduleAtFixedRate(BGM, 10000, 30000);//every 30 seconds

Problem is that during our stress testing on IBM WSAD we've noticed errors like J2CA0075W: An active transaction should be present

Upon researching this issue further i found this link http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21231761

which i think suggests that the servlet shouldnt be creating threads which make J2C connections. Our thread is making the DB connection.

does nay one have experince with this sort of problem? is it a bad programming construct to create threds in a servlet? if so..where should we be creating our threads? we want this thread to run every 30 seconds and this is a web appliction.

I'd appreciate any help

[1091 byte] By [bhaarat_javaa] at [2007-11-27 11:06:06]
# 1

I've created a POJO class that implements servletcontextlistener and took out the time thread from servlet and placed it in pojo's contextInitialized method. however, i still get the same warning.

bhaarat_javaa at 2007-7-29 13:13:05 > top of Java-index,Java Essentials,Java Programming...