我们正在我的sql数据库中使用struts2应用程序。几个月后,我们得到了java线程转储,应用程序停止响应。
线程转储如下:“http-0.0.0-8443-98”daemon prio=10 tid=0x0000000043229000 nid=0x54be waiting for monitor entry[0x00007f8b3b8b0000]java.lang.thread.state:blocked(在对象监视器上)at org.hsqldb.session.setautocommit(未知源)
“http-0.0.0-8443-179”daemon prio=10 tid=0x00007f8b3015c000 nid=0x571f waiting for monitor entry[0x00007f8b2faf9000]java.lang.thread.state:blocked(在对象监视器上)at org.apache.tomcat.util.net.jioendpoint.recyclewrkerthread(jioendpoint)。java:724)
“http-0.0.0-8443-175”daemon prio=10 tid=0x00007f8b30163800 nid=0x5713 in object.wait()[0x00007f8b3443b000]java.lang.thread.state:在java.lang.object.wait(本机方法)处等待(在对象监视器上)
“task-thread-for-com.mchange.v2.async。threadpertaskasynchronousrunner@2d2fa195“daemon prio=10 tid=0x000000005a06b800 nid=0x5631等待监视器条目[0x00007f8b34c4b000]java.lang.thread.state:阻塞(在对象监视器上)位于org.hsqldb.databasemanager.getdatabase(未知源)
“http-0.0.0-8443-127”守护进程prio=10 tid=0x000000005c334800 nid=0x54e0等待监视器条目[0x00007f8b37c76000]java.lang.thread.state:阻塞(在对象监视器上)在org.hsqldb.session.execute(未知源)
“defaultquartzscheduler\u worker-3”prio=10 tid=0x00007f8b714d4000 nid=0x5ac6 waiting for monitor entry[0x00007f8bed917000]java.lang.thread.state:blocked(在对象监视器上)at com.octopus.scheduler.tasks.synccertificateactivationthreads.activate(synccertificateactivationthreads)。java:62)
对于数据库,我们使用
public class ConnectionManager {
/* Object stores the value of lock */
private static final Object lock = new Object();
/**
* This method is used to get connection object holding the connection with
* the database. This connection object is created using
*
* @return Connection
*/
public Connection getDBConnection() {
Connection conn = null;
try {
InitialContext initialContext = new InitialContext();
IEntityManager manager = new EntityManager();
String dataSource = manager.getDatsourceInstance(application,
coreProduct);
DataSource ds = (DataSource) initialContext.lookup("java:"
+ dataSource);
if (ds != null) {
conn = ds.getConnection();
}
} catch (Exception e) {
e.printStackTrace();
}
return conn;
}
/**
* This method is use to generate the random id.
*
* @return
*/
public String generateId() {
return UUID.randomUUID().toString().substring(0, 13);
}
/**
* This method is use to generate the id which contains the current system
* time.
*
*/
public synchronized String generateNewId() {
String id = "";
synchronized (lock) {
// id = String.valueOf(System.currentTimeMillis());
id = String.valueOf(System.nanoTime());
}
return id;
}
由于这些应用程序停止运行,需要哪些参数、标准和配置来减少此类转储。
暂无答案!
目前还没有任何答案,快来回答吧!