oracle ORA-01002: 获取顺序错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16215711/
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
ORA-01002: fetch out of sequence
提问by m.edmondson
I'm getting the following oracle error when my app is deployed on the server only, and not when running the exact same executableon my local machine:
当我的应用程序仅部署在服务器上时,我收到以下 oracle 错误,而不是在本地计算机上运行完全相同的可执行文件时:
The stack trace points to a simple select statement with a join, that I can successfully execute via TOADlocally and via SQL Pluson the problem server.
堆栈跟踪指向一个带有连接的简单 select 语句,我可以通过本地TOAD和问题服务器上的SQL Plus成功执行该语句。
The top half of the stacktrace is:
堆栈跟踪的上半部分是:
Oracle.DataAccess.Client.OracleException ORA-01002: fetch out of sequence
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src, Boolean bCheck)
at Oracle.DataAccess.Client.OracleDataReader.Read()
at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.LoadAdapter.FillFromReader(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler)
at Reconciliation.Models.Legacy.EntityDbEnvironment.OpenEntity(String sql)
at Reconciliation.Models.Legacy.EntityDbEnvironment.Open(String& sql, DataTable& datatable)
**at myProject.Checks.ExecuteSql()**
I can only imagine this is an oracle client problem, but where should I look to resolve this?
我只能想象这是一个 oracle 客户端问题,但我应该在哪里解决这个问题?
回答by Antoine Dijoux
I had that issue too. My application was working fine on a machine, and the exact same executable on another machine was getting that fetch out of sequence exception.
我也有这个问题。我的应用程序在一台机器上运行良好,而另一台机器上的完全相同的可执行文件正在获取该提取异常。
My query is a big one which takes a few minutes to run. It is ran by a COM+. I realised that my two environments had a slightly different Component Services configuration. The failing environment had a transaction timeout set to 60s, the other one was set to much more.
我的查询很大,需要几分钟才能运行。它由 COM+ 运行。我意识到我的两个环境的组件服务配置略有不同。失败的环境将事务超时设置为 60 秒,另一个设置为更多。
To solve this I simply had to go to Component Services, right click on My Computer, Properties, Options, and increase the Transaction timeout.
为了解决这个问题,我只需转到组件服务,右键单击我的电脑,属性,选项,并增加事务超时。
It makes sense now as the fetch out of sequence exception is happening when you try to access a closed cursor. I understand that the COM+ timeout closed the transaction, therefore the cursor, and thrown that Oracle exception.
现在这是有道理的,因为当您尝试访问关闭的游标时,会发生乱序异常。我知道 COM+ 超时关闭了事务,因此关闭了游标,并引发了该 Oracle 异常。