Solved

Hanging on frm.show when the business object contains a collection w/ > 5000 objects

Posted on 2004-08-05
3
201 Views
Last Modified: 2010-04-23
The following roughly describes the sequence of events:

- mdi menu click event asks the business tier to populate an object

- parent business object calls the database and populates itself.  This includes a collection of 5000 child objects.  While debugging I can see that this successfully completes

- control returns to the MDI form where it Dims a windows form

- the windows form is successfully given a reference to the business object

- frm.Show is called

Execution in the debugger runs as expected until frm.show is called.  At this point execution hangs, CPU usage redlines, the form never appears, and I eventually stop the debugging (or, if I am running without the debugger, I must kill the program).  I can successfully load the form when I have only 1000 child objects.  Why would 5000 cause this failure... out-of-memory comes to mind, but why would it not fail while the 5000 objects are being created?  Furthermore, 5000 hardly feels like a "scary" number!

Thank you in advance for pointing me into the right direction to uncover my error!
0
Comment
Question by:bmccleskey
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 250 total points
ID: 11731932
what is the form doing on its load with the collection ?
0
 

Author Comment

by:bmccleskey
ID: 11732333
You pointed me into the right direction, and it was a silly mistake on my part.  I had assumed that execution was not making it into the form load event, so I didn't have a breakpoint set within the "being created" form.  Once I set the breakpoint and stepped into the form_load event, the bug in my looping logic was easy to spot.

A million thanks.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11732336
glad you got it.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question