473,225 Members | 880 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,225 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 1649
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.