jdbc 调用 oracle 11.1.0.7.0 db 阻塞
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1676855/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jdbc call to oracle 11.1.0.7.0 db blocked
提问by
The Jdbc call blocks and does not return back .. below is the stack trace
Jdbc 调用阻塞并且不返回.. 下面是堆栈跟踪
Oracle server = 11.1.0.7 Oracle thin driver used @ client
Oracle 服务器 = 11.1.0.7 使用的 Oracle 瘦驱动程序@客户端
Would appreciate your help ....
非常感谢您的帮助....
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:140)
at oracle.net.ns.Packet.receive(Packet.java:240)
at oracle.net.ns.DataPacket.receive(DataPacket.java:92)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:172)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1034)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1010)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:588)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:780)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:855)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:387)
at oracle.jdbc.driver.OracleDatabaseMetaData.getTypeInfo(OracleDatabaseMetaData.java:670)
回答by Shalomman
there might be few reasons:
可能有以下几个原因:
- This thread is locked in DB and waits for other thread commit(or rollback)
- This can be the firewall issue. Firewall may handle inappropriately stale connections. You can see more information here: http://forums.oracle.com/forums/thread.jspa?messageID=4354229
- 该线程被锁定在数据库中并等待其他线程提交(或回滚)
- 这可能是防火墙问题。防火墙可能会处理不当的陈旧连接。您可以在此处查看更多信息:http: //forums.oracle.com/forums/thread.jspa?messageID=4354229
回答by Pablo Santa Cruz
If you are running a stored procedure, it is apparently a JDBC THIN driver BUG.
如果你正在运行一个存储过程,它显然是一个 JDBC THIN 驱动程序的 BUG。
Update your JDBC driver to 11.0.2.2. It's supposed to fix the hang on getNextPacket issue:
将您的 JDBC 驱动程序更新到 11.0.2.2。它应该解决 getNextPacket 问题的挂起:
Oracle JDBC Drivers release 11.2.0.2 Readme.txt
===============================================
Note: this readme is specific to fixes in 11.2.0.2 patch-set; see
the master readme of the 11.2 release at http://download.oracle.com/otn/utilities_drivers/jdbc/112/Readme.txt
Bug# Description
======= ===========================================================================================
2935043 SQLException Invalid conversion error when binding short JDBC type to Oracle number column
5071698 PropertyCheckInterval of zero causes high CPU
6748410 registerOutParameter does not perform well in JDBC Thin
7208615 NUMBER column shows as precision 22 in JDBC
7281435 ORA-30006 during xa_commit cause XAER_RMERR in JDBC
8588311 PreparedStatement.setBinaryStream() does not read all the data from the stream
8592559 JDBC Thin cannot fetch PlsqlIndexByTable with more than 32k items
8617180 ORA-1458 error with large batch sizes using JDBC OCI driver
8832811 Non ASCII characters inserted into US7ASCII DB using JDBC Thin
8834344 Binding date of the Julian calendar throws IllegalArgumentException
8873676 JDBC This throws SqlException while reading invalid characters
8874882 ORA-22922 reusing large string bind for a LOB in JDBC
8889839 XA_RMERR being thrown on the recover(TMNOFLAGS) call from JDBC
8891187 JDBC does not close the connection after a fatal error
8980899 JDBC Thin new property enableDataInLocator for LOB data
8980918 JDBC Thin should use "data in locator" feature to save round-trips for small Lobs
8982104 Add JDBC support for SQLXML
9045206 11.2 JDBC driver returns zero rows with REF CURSOR OUT parameter
9099863 ps.setbytes on BLOB columns in batch does not inherit value to following lines
9105438 ORA-22275 during ps.executeBatch with LOBs
9121586 ORA-22925 getting large LOB via JDBC Thin 11.2
9139227 Wrong error code on JDBC connection failure
9147506 Named parameter in callable statement not working from JDBC
9180882 JDBC Statement.Execute does not handle comments as first elements for INSERT
9197956 JDBC Data Change Notification fails with IllegalArgumentException
9240210 Silent truncation reading 4gb BLOB with JDBC Thin 11.2
9259830 DatabaseChangeNotification fails to clean up
9260568 isValidObjectName() rejects valid object names
9341542 getmetadata().getindexinfo fails with quoted table names (ORA-947)
9341742 setBinaryStream causes dump/ORA-24804 if an unread stream is bound to a DML
9374132 Territory is allowed to be NULL resulting in ORA-12705
9394224 Poor performance for batch PreparedStatement execute with XMLType or objects.
9445675 "No more data" / ORA-3137 using end to end metrics with JDBC Thin
9468517 JDBC OCI and OCI do not behave the same on TAF failover
9491385 Memory not released using registerIndexTableOutParameter in JDBC Thin
9491954 RuntimeException "Assertion botch: negative time" from Timestamp bind
9660015 JDBC Thin hangs by waiting getnextpacket when calling stored procedure
9767715 TIMESTAMPTZ stringvalue truncates leading zeros in decimal part
9786503 Cannot use OS authentication with OracleXADataSource
Check out bug #9660015.
查看错误 #9660015。
Hope it helps.
希望能帮助到你。
回答by Tripp
It could be the Firewall issue, did you try checking, if the connections were active in DB, or did DB send the 10Byte ping data to this specific connections and it was OK ? If JDBC able to create the PreparedStatement from Connections it means the Connections were OK from client perspective, however the whats there between DB and Client ? Firewall ? router ? check their settings.
这可能是防火墙问题,您是否尝试检查连接是否在 DB 中处于活动状态,或者 DB 是否将 10Byte ping 数据发送到此特定连接并且没问题?如果 JDBC 能够从 Connections 创建 PreparedStatement 这意味着从客户端的角度来看 Connections 是可以的,但是 DB 和 Client 之间有什么关系?防火墙?路由器?检查他们的设置。