Spark 实践 - Spark Streaming 应用程序中的错误:ORA-01000: maximum open cursors exceeded
2016-12-28 11:25
507 查看
一、问题描述
使用Spark Streaming 编写处理实时消息的应用唾弃,然后将计算后的数据写回Oracle,给Web应用程序使用,Spark Streaming应用程序启动后,运行几个周期之后报出异常,自动重启后又报出异常:
java.sql.SQLException: ORA-01000: maximum open cursors exceeded
显然是应用程序中对相同的数据库实例进行操作的线程过多,导致超出Oracle的最大处理能力,Oracle拒绝我们应用程序的请求。那就排查问题。我已经使用了连接线程池,按道理不会有太多的线程跑起来,而且线程池设置为4个,是不应该有线程爆满的隐患的,继续看数据库操作那块代码,嘿,问题找到:发现command对象没有关闭操作,用完记得关闭command。
二、解决方法
1、使用数据库连接线程池;
2、使用完command对象记得关闭。
使用Spark Streaming 编写处理实时消息的应用唾弃,然后将计算后的数据写回Oracle,给Web应用程序使用,Spark Streaming应用程序启动后,运行几个周期之后报出异常,自动重启后又报出异常:
java.sql.SQLException: ORA-01000: maximum open cursors exceeded
显然是应用程序中对相同的数据库实例进行操作的线程过多,导致超出Oracle的最大处理能力,Oracle拒绝我们应用程序的请求。那就排查问题。我已经使用了连接线程池,按道理不会有太多的线程跑起来,而且线程池设置为4个,是不应该有线程爆满的隐患的,继续看数据库操作那块代码,嘿,问题找到:发现command对象没有关闭操作,用完记得关闭command。
二、解决方法
1、使用数据库连接线程池;
2、使用完command对象记得关闭。
相关文章推荐
- Controller中执行一段时间后出现错误"ORA-01000: maximum open cursors exceeded"解决办法
- [Bug]ArcSDE分区表报:ORA-01000 maximum open cursors exceeded
- About Exception "ORA-01000: maximum open cursors exceeded"
- 处理超出打开游标的最大数异常(ORA-01000: maximum open cursors exceeded)
- 处理超出打开游标的最大数异常(ORA-01000: maximum open cursors exceeded)
- oracle ORA-01000:maximum open cursors exceeded
- How to resolve maximum open cursors exceeded on Oracle(ORA-01000)-- 1
- ORA-01000: maximum open cursors exceeded 超出打开游标的最大数的原因和解决方案
- ORA-01000: maximum open cursors exceeded
- ORA-01000: maximum open cursors exceeded
- 出错"ORA-01000: maximum open cursors exceeded" 问题分析
- 处理超出打开游标的最大数异常(ORA-01000: maximum open cursors exceeded)
- 关于ORACLE游标的问题(ORA-01000: maximum open cursors exceeded)
- 关于ORA-01000: maximum open cursors exceeded 在Websphere里
- ORA-01000: maximum open cursors exceeded, 引发的JDBC, DBPool的思考
- java.sql.SQLException: ORA-01000: maximum open cursors exceeded
- ORA-01000: maximum open cursors exceeded
- ora-01000 maximum open cursors exceeded
- OleDB Transaction ORA-01000: maximum open cursors exceeded 超出打开游标的最大数
- [JDBC]ORA-01000: 超出打开游标的最大数(ORA-01000: maximum open cursors exceeded)