当我访问 ADODB 字段值时,是什么导致 System.AccessViolationException?

发布于 2024-08-29 03:28:38 字数 410 浏览 6 评论 0原文

我正在从 .Net Web 服务(均在 Windows XP 计算机上)连接到 PostgreSQL 数据库。最近,我们在几台不同的计算机上多次收到 System.AccessViolationException 错误。

我能够获得的一个堆栈跟踪表明,当我获取 ADODB.recordset 并获取字段的值时,就会发生这种情况。 例如,

Dim rs as ADODB.Recordset = 'initialize recordset via a query to database
MsgBox(rs("fieldName").Value)

这并不总是失败;它很少失败。我们在其中一台计算机上运行memtest,没有发现任何问题。

问题可能是什么?如果是司机,我有什么选择?

I am connecting to a PostgreSQL database from a .Net web service (both on a Windows XP machine). On a few occasions recently, on a few different computers, we have received System.AccessViolationException errors.

One stack trace I was able to obtain showed that it was occuring when I took an ADODB.recordset and obtained the value of a field.
e.g.

Dim rs as ADODB.Recordset = 'initialize recordset via a query to database
MsgBox(rs("fieldName").Value)

This does not always fail; it rarely fails. We ran memtest on one of the computers and found no problems.

What could the problem be? If it's the driver, what are my options?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

恰似旧人归 2024-09-05 03:28:38

首先要做的是尝试升级 ADODB 提供程序(有时称为驱动程序)。这可能代表某种可能已修复的罕见错误。然而,它很少失败这一事实对我来说是一个危险信号,并表明某处存在某种并发问题。这是一个多线程应用程序吗?此时其他线程在做什么?这有可能是竞争条件吗?

要检查的第二件事是某些值是否会持续使程序崩溃。也许 byteas 中嵌入了空值或其他东西?

然而,这很可能是驱动程序的问题。如果您发现任何类似的问题,始终可以从这里开始。

The first thing to do is try to upgrade the ADODB provider (sometimes called a driver). This may represent a rare bug of some sort that may have been fixed. However the fact that it rarely fails is a bit of a red flag to me and suggests some sort of concurrency problem somewhere. Is this a multi-threaded application? What are other threads doing at the time? Is it possible this is a race condition?

A second thing to check would be if some values can consistently crash the program. Maybe there are embedded nulls in byteas or something?

Most likely however, this is an issue with the driver. If you see any issue that is similar, that's always the place to start.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文