求websphere连接池错误原因
[04-7-17 12:33:09:359 CST] 3c22d51e SharedPool I J2CA0086W: 在本地事务包含边界中使用的资源 jdbc/drvsys 的可分享连接 MCWrapper id 6b0b152f Managed connection com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl@68b3152f State:STATE_TRAN_WRAPPER_INUSE
取连接代码
public static Connection getSCN() {
// System.err.println(connType);
if (connType.equals("websphere")) { //
Connection conn;
try {
InitialContext context = new InitialContext();
DataSource ds = (DataSource) context.lookup("jdbc/drvsys");
conn = ds.getConnection();
return conn;
}
catch (SQLException ex) {
ex.printStackTrace();
return null;
}
catch (NamingException ex) {
ex.printStackTrace();
return null;
}
}
else if (connType.equals("selfpool")) {
if (cnm == null) {
cnm = DBConnectionManager.getInstance();
}
return cnm.getConnection("idb");
}
else {
return null;
}
}
/**
*将数据库连接返回连接池,静态方法
* @param connection 要释放的数据库连接
*/
public static void closeSCN(Connection connection) {
if (connType.equals("websphere")) { //
try {
connection.close();
}
catch (SQLException ex) {
ex.printStackTrace();
}
}
else if (connType.equals("selfpool")) {
cnm.freeConnection("idb", connection);
cnm.release();
}
}