473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Question on Program Hanging

Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.

There is nothing different about Saturday that I can think of.

Any help tracking this down would be appreciated!
Thanks

Robert

Here is the code snip:

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Start Grab New
Invoices") ; // Simply writes out to a log file

ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " End Grab New
Invoices") ;

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For each
Next");

// ****************************************** HANGS Here or

tempRowCount = ds.Tables[0].Rows.Count;

// ****************************************** HANGS Here

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count " +
tempRowCount.ToString() ) ;

foreach (DataRow dr in ds.Tables[0].Rows)

{

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Email the
Invoice") ;

CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

gds.CustNum = dr["CustNum"].ToString() ;

gds.QuoteNum = dr["OrdNum"].ToString() ;

gds.UpdateTheData("InvoicesEmailed") ;

}

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Exiting") ;


Jun 27 '08 #1
3 1659
On May 13, 12:22*pm, "Microsoft" <Robert12...@nospam.nospamwrote:
Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.
What error are you getting?
Check AppDomain.UnhandledException

Jun 27 '08 #2
Hi Robert,

As for such hang behavior problem, generally, if we can not get clear clus
from code logic, it will require some debugging work on it (such as find
the blocking thread and resource).

Not sure whether you've already read some about managed debugging on
application hang, here are some good blog article about managed debugging:

#.NET Debugging Demos Lab 1: Hang
http://blogs.msdn.com/tess/archive/2...mos-lab-1-hang
.aspx

#.NET Hang Debugging Walkthrough
http://blogs.msdn.com/tess/archive/2...ng-walkthrough
.aspx

BTW, as you provided the code snippet and the potential block point, how
did you originally track down to it? Also, it seems there are many method
calls on a custom class, has it accessed any particular resource or objects
that may cause problem?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Microsoft" <Ro*********@nospam.nospam>
Subject: Question on Program Hanging
Date: Tue, 13 May 2008 12:22:45 -0400
>Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.

There is nothing different about Saturday that I can think of.

Any help tracking this down would be appreciated!
Thanks

Robert

Here is the code snip:

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " Start Grab
New
>Invoices") ; // Simply writes out to a log file

ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " End Grab New
Invoices") ;

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each
>Next");

// ****************************************** HANGS Here or

tempRowCount = ds.Tables[0].Rows.Count;

// ****************************************** HANGS Here

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count "
+
>tempRowCount.ToString() ) ;

foreach (DataRow dr in ds.Tables[0].Rows)

{

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Email the
Invoice") ;

CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

gds.CustNum = dr["CustNum"].ToString() ;

gds.QuoteNum = dr["OrdNum"].ToString() ;

gds.UpdateTheData("InvoicesEmailed") ;

}

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToS tring() + " Exiting") ;


Jun 27 '08 #3
Hi Robert,

Have you got any progress on this issue or does those information help
some? Since such hanging or crash problem is likely to be hard for
troubleshooting, especially in production environment. If you still have no
luck on this and feel it an urgent issue, I would suggest you consider
contacting CSS for incident based support:

Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: st*****@online.microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Wed, 14 May 2008 04:55:02 GMT
Subject: RE: Question on Program Hanging
>
Hi Robert,

As for such hang behavior problem, generally, if we can not get clear clus
from code logic, it will require some debugging work on it (such as find
the blocking thread and resource).

Not sure whether you've already read some about managed debugging on
application hang, here are some good blog article about managed debugging:

#.NET Debugging Demos Lab 1: Hang
http://blogs.msdn.com/tess/archive/2...emos-lab-1-han
g
>.aspx

#.NET Hang Debugging Walkthrough
http://blogs.msdn.com/tess/archive/2...ing-walkthroug
h
>.aspx

BTW, as you provided the code snippet and the potential block point, how
did you originally track down to it? Also, it seems there are many method
calls on a custom class, has it accessed any particular resource or
objects
>that may cause problem?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ault.aspx#noti
f
>ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================= =
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>>From: "Microsoft" <Ro*********@nospam.nospam>
Subject: Question on Program Hanging
Date: Tue, 13 May 2008 12:22:45 -0400
>>Hi

I have a c# program that continually runs 24/7 and performs a variety of
tasks based on a timer.

There is one routine that hangs every Saturday morning without fail. If I
restart the program throughout the week is still hangs. I can restart it
immediatly after the hang and it runs fine until next Saturday.

There is nothing different about Saturday that I can think of.

Any help tracking this down would be appreciated!
Thanks

Robert

Here is the code snip:

af.AddToFile(Constants.c_LogFile,DateTime.Now.To String() + " Start Grab
New
>>Invoices") ; // Simply writes out to a log file

ds = gds.GrabTheData("NewInvoices"); // ar_GetEmailInvoice01 - Puts data
into a dataset

af.AddToFile(Constants.c_LogFile,DateTime.Now.To String() + " End Grab New
Invoices") ;

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each");

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Start For
each
>>Next");

// ****************************************** HANGS Here or

tempRowCount = ds.Tables[0].Rows.Count;

// ****************************************** HANGS Here

af.AddToFile(Constants.c_LogFile, DateTime.Now.ToString() + " Row Count "
+
>>tempRowCount.ToString() ) ;

foreach (DataRow dr in ds.Tables[0].Rows)

{

af.AddToFile(Constants.c_LogFile,DateTime.Now.ToSt ring() + " Email the
Invoice") ;

CreateInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

EmailInvoice(dr["CustNum"].ToString(),dr["OrdNum"].ToString()) ;

gds.CustNum = dr["CustNum"].ToString() ;

gds.QuoteNum = dr["OrdNum"].ToString() ;

gds.UpdateTheData("InvoicesEmailed") ;

}

af.AddToFile(Constants.c_LogFile,DateTime.Now.To String() + " Exiting") ;



Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jonathan | last post by:
Hi all! For a match schedule I would like to find all possible combinations of teams playing home and away (without teams playing to themselves of course). I now the simple version works...
8
by: briforge | last post by:
I am writing a program for the Palm OS in c++. I have already posted this to a palm development forum but I'm desperate for a fix, so I hope this cross-post isn't offensive. My program is...
2
by: Arben Qarkaxhija | last post by:
Hello all, I'm new to AS400 and we have a problem here with a sql-procedure, that is running OK over the Client Access Navigator, but over the 5250 emulator hanging with an error "pointer for...
10
by: feel52 | last post by:
Below you'll find the code i'm working on. It's in a button click routine and hangs after 3 or 4 sometimes 5 loops done, probably in sock.receive(....). Some code was found here( on google i mean)...
0
by: joeted | last post by:
Hi, I am using system.diagnostic.process with the intention of running a program to communicate with a unix box: The program is "PuTTY", running from a batch script. I know it works because...
4
by: jdc_1040 | last post by:
Could someone explain what the scope chain looks like to code running inside eval? (Please no "eval is the devil" essays :) ) Let's say I have a string of JavaScript that looks like this: var...
0
by: Materialised | last post by:
Hi All, My program is hanging when I call a function for convert a image file to base64. I am wondering if I handled the call to this function within a different thread if it would make any...
1
by: =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= | last post by:
Hello guys, I was wondering if anybody here had implemented a solution where Tables are aligned according to what the hanging indent tells us when there is a potential for the table overflowing...
1
kreagan
by: kreagan | last post by:
I have software for a BERT that networks with a external database (SMU). The program requests information from the SMU and waits for a response. Sometimes, the software hangs while waiting for the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.