I have a c# 3.5 framework Windows application that runs against an Oracle DB located on a server.
One of the forms of the application has eight tabs across the top. Within the tab content area of each tab is a combobox. The combobox displays the same information on each form. When the user changes the combobox value using the dropdown or keyboard arrows, then the eight tabbed areas are populated with the data as pulled from Oracle.
Based on the structure of the existing program, every time the combobox is changed, about 20 individual DB connections are opened. First, about 8 are called to save data from the different tabs to their correct table. Contents of each tab are passed to a DB class for saving that tab's data. Second, about 8 DB calls are made to load the tabs, from tables, based on the combobox.
To clarify, it would be like picking a combobox on any tab that changes the model of a car. Each tab then would be stuff like "interior options" "engine options" etc.
Then a couple of DB calls are made to lock the High-level record based on an ID so no one else can edit that particular record at the same time.
The process, overall, is pretty solid. The save/load time are blazing fast. I can switch back and forth between two different combobox values with almost instant data saves/loads.
THEN COMES THE PROBLEM
If I spin back and forth fast enough (which a couple of the users have done as well), the whole program hangs. No crash, just hangs.
Repeating this in the debug environ, I found it was always stopping on the same line of code (a simple recordset assignment ( for example CarModelInterior.Notes = Convert.ToString(myReader[6]);)
Then I found the Garbage Collector (GC) thread was running in the background but was also stopping at the same place each time.
Enter installation of the RED-Gate Memory/Performance monitors.
What I found was that the faster and faster I was switching the combobox values, the faster the GC Finalizer queue was filling up. Ultimately, it appears that the same SQL call was at the top of the list.
Enter my assumptions and guesswork.
My thought is that either there are too many connections opened and not being finalized fast enough or there is a lock going on somewhere.
What I can say is that ALL (each and every freaking one) of my DB calls in the whole program use the "USING" statement so all disposing is completed automatically. Also, ALL (as in yes I checked the whole application), ALL of the DB calls are on the primary thread. Therefore, all the 20-or-so DB calls made for each combobox value change are made in order. This has eliminated the locking possibility at least as far as being a possible single-thread issue.
What do I have left? At this point, so much googling that I've given up and posted here. Is it possible the finalize queue isn't processing fast enough? Any other ideas?