堆栈跟踪指向带有连接的简单select语句,我可以通过 TOAD成功执行在本地,并通过问题服务器上的 SQL Plus . stacktrace的上半部分是: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()**我只能想象这是一个oracle客户问题,但是我应该在哪里解决呢?解决方案我也遇到了这个问题.我的应用程序在一台机器上运行良好,而另一台机器上完全相同的可执行文件却导致该提取顺序异常.我的查询很大,需要几分钟才能运行.它由COM +运行.我意识到我的两个环境的组件服务配置略有不同.失败的环境将事务超时设置为60s,另一个环境设置为更多.要解决此问题,我只需要转到组件服务",右键单击我的电脑",属性",选项",然后增加事务超时".这很有意义,因为当您尝试访问封闭的游标时,发生了提取顺序异常.我知道COM +超时关闭了事务,因此关闭了游标,并引发了该Oracle异常. I'm getting the following oracle error when my app is deployed on the server only, and not when running the exact same executable on my local machine:The stack trace points to a simple select statement with a join, that I can successfully execute via TOAD locally and via SQL Plus on the problem server.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? 解决方案 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.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. 这篇关于ORA-01002:未按顺序提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!