stackoverflowexception的问题 [英] problems with stackoverflowexception

查看:89
本文介绍了stackoverflowexception的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我遇到了这个异常的一些奇怪问题(错误)。

如果我使用sql命令将数据插入到sql中服务器我得到

我的应用程序的奇怪行为。


首先我使用单线程应用程序并使用

Application.DoEvents( )当我需要等待一段时间。

(我需要处理一些关于事件的外部信息

所以我不能只使用Thread.Sleep)。 />
我需要定期存储一些信息

(约1分钟)所以首先我使用xml来存储信息。

但是在申请执行后有一段时间DataSet习惯了
商店信息会被破坏(?!)而且我会收到

对象未设置为引用错误。所以我切换到SQL服务器。

首选MSDE。我使用了存储过程并从应用程序中执行了
,但应用程序显示出奇怪的行为,并且执行存储过程时有时会停止


秒。通常会停止并且不会继续。

所以我切换到MySQL和文本查询。但我开始收到

StackOverflowException。我感到困惑并改变了应用程序

因此它不再是单线程应用程序而是

的Application.DoEvents()我使用Thread.Sleep

但奇怪的是Stackoverflowexception仍然存在。


在应用程序中,如果不是执行非查询,我只需从该函数程序返回

就可以了。没有什么错误

使用sql部分代码,但是我无法解决这个问题。

我对这个问题感到非常绝望。在WinXP SP2上使用.NET 1.1和SP1


Hi!

I''m having some wierd problems with this exception (error).
If I use sql commands to insert data into sql server i get
strange behaviour from my application.

First I used a single threaded application and used
Application.DoEvents() when i needed to wait some time.
(I need to process some external information on events
so I can''t just use Thread.Sleep).
I need to store some information on regular basis interval
(about 1 minute) so firstly i used xml to store information.
But after application executed for some time DataSet used to
store information would get destroyed (?!) and I would receive
Object not set to reference error. So I switched to SQL server.
First choice MSDE. I used stored procedures and executed them
from application, but application showed strange behaviour and
would sometimes stop when executing stored procedures for a few
seconds. Often it would stop and would not continue.
So I switched to MySQL and text queries. But I started to receive
StackOverflowException. I got confused and changed application
so it''s not anymore a single threaded application and instead
of Application.DoEvents() I use Thread.Sleep
But strangely the Stackoverflowexception remained.

In application if instead of executing nonqueries I just return
from that function program works fine. There is nothing wrong
with sql part of the code, but I can''t get a lock on the problem.
I''m getting desperate with this problem. Using .NET 1.1 with SP1
on WinXP SP2.

推荐答案


我对这个异常有一些奇怪的问题(错误)。
如果我使用sql命令将数据插入sql server我会从我的应用程序中获得奇怪的行为。
<首先,我使用单线程应用程序并在需要等待一段时间后使用了Application.DoEvents()。
(我需要处理一些有关事件的外部信息
所以我可以我只需要使用Thread.Sleep。
我需要定期存储一些信息
(大约1分钟)所以首先我使用xml来存储信息。
但是在应用程序执行之后一段时间以来用于存储信息的DataSet会被破坏(?!)而且我会收到
对象未设置为引用错误。所以我切换到SQL服务器。
首选MSDE。我使用存储过程并从应用程序执行它们,但应用程序显示奇怪的行为,并且有时会在执行存储过程几秒钟时停止。通常它会停止并且不会继续。
所以我切换到MySQL和文本查询。但是我开始收到了StackOverflowException。我感到困惑并改变了应用程序
所以它不再是单线程应用程序而是Application.DoEvents()我使用Thread.Sleep
但奇怪的是Stackoverflowexception仍然存在。在应用程序中,如果不是执行非查询,我只是从该函数程序返回
工作正常。使用sql部分代码没有什么不对,但我无法解决这个问题。
我对这个问题感到绝望。在WinXP SP2上使用带有SP1的.NET 1.1。
I''m having some wierd problems with this exception (error).
If I use sql commands to insert data into sql server i get
strange behaviour from my application.

First I used a single threaded application and used
Application.DoEvents() when i needed to wait some time.
(I need to process some external information on events
so I can''t just use Thread.Sleep).
I need to store some information on regular basis interval
(about 1 minute) so firstly i used xml to store information.
But after application executed for some time DataSet used to
store information would get destroyed (?!) and I would receive
Object not set to reference error. So I switched to SQL server.
First choice MSDE. I used stored procedures and executed them
from application, but application showed strange behaviour and
would sometimes stop when executing stored procedures for a few
seconds. Often it would stop and would not continue.
So I switched to MySQL and text queries. But I started to receive
StackOverflowException. I got confused and changed application
so it''s not anymore a single threaded application and instead
of Application.DoEvents() I use Thread.Sleep
But strangely the Stackoverflowexception remained.

In application if instead of executing nonqueries I just return
from that function program works fine. There is nothing wrong
with sql part of the code, but I can''t get a lock on the problem.
I''m getting desperate with this problem. Using .NET 1.1 with SP1
on WinXP SP2.



我想重新输入调用Application.DoEvents()的代码,

像这样:


void Idle(){

Application.DoEvents();

}


void SomeUIEventHandler(...){

空闲();

}


解决方案:使用线程或保证那个Application.DoEvents()

永远不会被重新进入。


再见

Rob


ps:不要像你的裤子那样切换技术;-)选择

one并坚持下去直到它起作用。


I guess the code that calls Application.DoEvents() is reentered,
like this:

void Idle() {
Application.DoEvents();
}

void SomeUIEventHandler(...) {
Idle();
}

Solution: use threads or assure that Application.DoEvents()
is never reentered.

bye
Rob

ps: don''t switch technologies like your pants ;-) Choose
one and stick with it until it works.


Robert Jordan写道:
Robert Jordan wrote:

StackOverflowException。我感到困惑并改变了应用程序
所以它不再是单线程应用程序而是Application.DoEvents()我使用Thread.Sleep
但奇怪的是Stackoverflowexception仍然存在。
StackOverflowException. I got confused and changed application
so it''s not anymore a single threaded application and instead
of Application.DoEvents() I use Thread.Sleep
But strangely the Stackoverflowexception remained.



我想重新输入调用Application.DoEvents()的代码,如下所示:

void Idle(){
应用程序。 DoEvents();
}

void SomeUIEventHandler(...){
Idle();
}
解决方案:使用线程或确保Application.DoEvents()
永远不会被重新进入。

再见
Rob

ps:不要像你的裤子那样切换技术; - )选择
一个并坚持下去,直到它工作。



I guess the code that calls Application.DoEvents() is reentered,
like this:

void Idle() {
Application.DoEvents();
}

void SomeUIEventHandler(...) {
Idle();
}

Solution: use threads or assure that Application.DoEvents()
is never reentered.

bye
Rob

ps: don''t switch technologies like your pants ;-) Choose
one and stick with it until it works.




你没有仔细阅读我的帖子。我说我更改了应用程序

所以它使用线程并且不会调用app.doevents


ps。 :) 当然。目标是针对MySQL的,但我在MSDE中有更多的经验

,所以我先尝试了这个



You didn''t read my post carefuly. I said I changed application
so it uses threads and doesn''t call app.doevents

ps. :) Of course. Goal was for MySQL, but I have more experience
in MSDE, so I tried that first


无论是什么,都会无意中重复执行某些事情并且每次迭代消耗

堆栈。它不是SQL而是代码。你提到''约1

分钟''?这听起来像是一个迭代的事情,不是吗?没有实际的

代码不能说更多。
Whatever it is, something gets executed repeatedly unintended and consumes
stack on each iteration. It will not be SQL but code. You mention ''about 1
minute''? That sounds like an iterating thing, doesn''t it? Without the actual
code can''t say much more.


这篇关于stackoverflowexception的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆