Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-27-2009, 10:39 AM   PM User | #1
scorpius420
New Coder

 
Join Date: Jan 2009
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
scorpius420 is an unknown quantity at this point
Unhappy .net mysql read() method freeze

Hello, I'm getting a rather bizarre problem.

I am using mysql with c# and .net, visual studio 2005. I have a simple loop to read data based on a query until the results are exhausted:

while(datarader.Read())
{
//do stuff
}

Now...I am trying to go through many thousands of records...and this loop is sort of required to run for more than an hour. It works fine for a while... but in the middle it freezes.

In debug mode I found out that it freezes on the .Read() method, so the culprit is not my own code. if I try to step over Read() it simply stays there.

If I try to make it "continue" it simply returns to the freeze state. It does not terminate the application or throw an exception however.

What is going on and how can I fix it? Thank you for any help!!
scorpius420 is offline   Reply With Quote
Old 11-28-2009, 11:36 PM   PM User | #2
vinyl-junkie
$object->toCD-R(LP);


 
vinyl-junkie's Avatar
 
Join Date: Jun 2003
Posts: 3,054
Thanks: 2
Thanked 22 Times in 22 Posts
vinyl-junkie is on a distinguished road
Your server could be timing out on you.

What kind of a query are you using? Can it be changed so that it's more efficient?
__________________
Music Around The World - Collecting tips, trade
and want lists, album reviews, & more
SNAP to it!
vinyl-junkie is offline   Reply With Quote
Old 11-29-2009, 03:35 PM   PM User | #3
scorpius420
New Coder

 
Join Date: Jan 2009
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
scorpius420 is an unknown quantity at this point
Well..if it was timing out I would be gettting a fatal error exception.

Though it could be some bizarre thing happening at low level where the connection is trying to close because of timeout and the read operation is trying to happen at the same time.

One possible thing might be that ..since I have scores of thousands of records and the script takes hours, maybe the default way in which the read op is done is causing a problem and I need to set commandbehavior to single row.

It's really weird...I will have to try it out on monday.

The query is a basic select thing with a where clause.
scorpius420 is offline   Reply With Quote
Reply

Bookmarks

Tags
.net, freeze, hang, mysql, read

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:08 PM.


Advertisement
Log in to turn off these ads.