各位熟悉resin服务器的进来一下,给分析分析,实在是不知道怎么下手查!-_- 服务器应该都能配置自身的内存吧,你试着配置一下tomcat可以配置容器内存的,我觉得resin应该也能,但是我没有用过resin只能帮你这点忙了!呵呵加油啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 OnlyFor_love(『清水出芙蓉,天然去雕饰』) ,谢谢你问题可能找到了,这几个平台都只是有一个servlet,我在初始化的时候把数据库连上。当程序中用的时候会判断连接是否可以用,若不可用便会自己建立一个连接。我现在想resin服务器和数据库服务器的网络连接肯定有问题,肯定是断掉之后一直去连数据库结果导致页面显示不了。不过现在只是猜测,不知道是不是这样。若是这样的话那我的程序也没办法改了 -_-烦啊,刚才又给瘫了。 俺现在把连库的代码贴出来,各位给看一下,是不是俺写的不对啊。/** * 得到数据库连接,程序中进行数据库操作的时候会通过这个方法取到连接 * * @return 当前Context对象中的数据库连接 */public Connection getDBConnection() { try { if (connection == null || connection.isClosed()) { connection = DBMgr.getConnectionWithoutPool(); connection.setAutoCommit(false); log.debug("数据库连接已断开,重新取到一个数据库连接"); } } catch (SQLException e) { log.error("取不到数据库连接", e); } return connection;}DBMgr中的getConnectionWithoutPool方法,俺是这样写的/** * 这个方法主要的目的是在从metadata中得到数据库表数据时 有的数据库会出现访问异常,所以提供直接连接数据库的方法 * 用于的到数据库表的meta信息。 * * @return 数据库连接 */public static Connection getConnectionWithoutPool() { if (jdbcUrl == null) { throw new IllegalStateException( "Configuration property \"db.url\" not found"); } if (jdbcUserName == null) { throw new IllegalStateException( "Configuration property \"jdbcUserName\" not found"); } if (jdbcPassword == null) { throw new IllegalStateException( "Configuration property \"jdbcPassword\" not found"); } try { //log.debug("开始直接连接数据库!没有创建数据库连接池!"); // Register basic JDBC driver Class driverClass = Class.forName(jdbcDriver); Driver basicDriver = (Driver) driverClass.newInstance(); return DriverManager.getConnection(jdbcUrl, jdbcUserName, jdbcPassword); } catch (Exception e) { log.warn("在没有创建数据库连接池的情况下,连接数据库发生异常", e); return null; }} 程序没有毛病啊,不知道你在具体操作数据库的时候,得到的connection连接在操作完后之后有没有关闭连接呢? 问题找到了,谢谢OnlyFor_love(『清水出芙蓉,天然去雕饰』) 是resin记了好多日志有11G大把磁盘空间都占满了,我狂晕。 如何使用ujmp的矩阵运算方法 有点迷糊..求助~~关于hibernate的一点小疑问.. 国产超强框架guzz,取代hibernate和ibatis 各位高手,寻求答案! 请问怎样在windows 下 JAVA 调用 shell 脚本 过滤器的问题,请大家帮忙一下 JAVA 高手们,帮忙看看 ! jstl连接mysql的乱码问题.. jboss启动报Failed to find factory for event: javax.management.Notification,是什么原因? 请问一个关于struts的问题 大家说说看,当当怎么样?个人认为太烂了 组装字符串问题
问题可能找到了,这几个平台都只是有一个servlet,我在初始化的时候把数据库连上。当程序中用的时候会判断连接是否可以用,若不可用便会自己建立一个连接。
我现在想resin服务器和数据库服务器的网络连接肯定有问题,肯定是断掉之后一直去连数据库结果导致页面显示不了。
不过现在只是猜测,不知道是不是这样。若是这样的话那我的程序也没办法改了 -_-烦啊,刚才又给瘫了。
* 得到数据库连接,程序中进行数据库操作的时候会通过这个方法取到连接
*
* @return 当前Context对象中的数据库连接
*/
public Connection getDBConnection() {
try {
if (connection == null || connection.isClosed()) {
connection = DBMgr.getConnectionWithoutPool();
connection.setAutoCommit(false);
log.debug("数据库连接已断开,重新取到一个数据库连接");
}
} catch (SQLException e) {
log.error("取不到数据库连接", e);
}
return connection;
}
DBMgr中的getConnectionWithoutPool方法,俺是这样写的
/**
* 这个方法主要的目的是在从metadata中得到数据库表数据时 有的数据库会出现访问异常,所以提供直接连接数据库的方法
* 用于的到数据库表的meta信息。
*
* @return 数据库连接
*/
public static Connection getConnectionWithoutPool() {
if (jdbcUrl == null) {
throw new IllegalStateException(
"Configuration property \"db.url\" not found");
}
if (jdbcUserName == null) {
throw new IllegalStateException(
"Configuration property \"jdbcUserName\" not found");
}
if (jdbcPassword == null) {
throw new IllegalStateException(
"Configuration property \"jdbcPassword\" not found");
}
try {
//log.debug("开始直接连接数据库!没有创建数据库连接池!");
// Register basic JDBC driver
Class driverClass = Class.forName(jdbcDriver);
Driver basicDriver = (Driver) driverClass.newInstance();
return DriverManager.getConnection(jdbcUrl, jdbcUserName,
jdbcPassword);
} catch (Exception e) {
log.warn("在没有创建数据库连接池的情况下,连接数据库发生异常", e);
return null;
}
}
是resin记了好多日志有11G大把磁盘空间都占满了,我狂晕。