Weblogic错误 - 不支持的方法:Statement.cancel

时间:2009-05-29 03:09:13

标签: jdbc weblogic

我在Weblogic 9.2 MP3上运行一个应用程序,目前连接池有问题。

ERROR - UserBean retrieving user record. weblogic.jdbc.extensions.PoolLimitSQLException: 
weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool MyApp Data Source to allocate to applications, please increase the size of the pool and retry..

我也一直收到以下错误消息,说“Method not supported : Statement.cancel()”,我认为这是上述错误的原因。

<Error> <JDBC> <BEA-001131> <Received an exception when closing a cached statement for the pool "MyApp Data Source": java.sql.SQLException: Method not supported : Statement.cancel()..>

我浏览了应用程序源代码,该方法似乎根本没有被应用程序使用。虽然它可能与weblogic本身有关。

任何人都有任何想法修复此错误?

1 个答案:

答案 0 :(得分:0)

首先,我要确保关闭每个java.sql.Connection变量。

e.g。

final Connection connection = dataSource.getConnection();

// do your database work here

if (connection != null) {
    connection.close();
}

通过将connection.close();放入try / catch块的finally部分,您可能会使其更加紧凑。