You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ESENT错误JET_errOutOfCursors(-1013)咨询:含义及游标数查看方法

Understanding JET_errOutOfCursors (-1013) and Checking Available Cursors in ESENT

First off, let's demystify that error: JET_errOutOfCursors (-1013) simply means your application has hit the maximum number of table cursors allowed by your ESENT instance. Cursors are ESENT's way of tracking a position in a table—every time you call JetOpenCursor to start reading or writing data, you're consuming one of these limited resources. If you open more cursors than the configured limit without closing them, you'll trigger this error.

How to Check Cursor Usage at a Specific Time

To get clear visibility into your cursor counts, use ESENT's built-in statistics functions:

  • Get active cursor count: Call JetGetInstanceStats and inspect the cCursor field in the returned JET_INSTANCE_STATS structure. This number tells you exactly how many cursors are currently open across your entire ESENT instance.
  • Find the maximum allowed cursors: Use JetGetSystemParameter with the JET_paramMaxCursors parameter to retrieve the current limit. By default, this value is usually 1024, but it can be adjusted during instance initialization if needed.

Quick Fixes to Resolve the Error

  • Close cursors properly: The most common cause is leaked cursors. Always pair every JetOpenCursor call with a JetCloseCursor once you're done with that cursor. Make sure to handle exceptions too—wrap cursor cleanup in finally blocks (or equivalent) to avoid leaving cursors open if an error occurs.
  • Reuse cursors where possible: If you're opening multiple cursors on the same table for similar operations, see if you can reset or reposition an existing cursor instead of creating a new one. This cuts down on unnecessary resource usage.
  • Adjust the cursor limit: If your workload genuinely requires more cursors, increase the JET_paramMaxCursors value via JetSetSystemParameter when initializing your ESENT instance. Keep in mind that higher limits consume more memory, so balance this with your application's memory constraints.

Content of the question originates from Stack Exchange, asked by user pjaall

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 19:07:43