App doesn't always close out

Hi. I have an app I'm testing before sending it out to the users. I will run the app, and close out of it, by either pressing the exit button I have added, or clicking on the X in the JFrame. Usually when I do this, the DOS prompt will display "Press any key to continue" so I know it has closed out. Every once in a while, this message doesn't appear on the DOS prompt. When I look in task manager, the java.exe still shows as a process. This is the class I have that is supposed to close out the app,

I have the above window listener added to the JFrame. Here is the code that runs when the exit button is pressed...

Why doesn't the app always close out? I would say about 90% of the time, it closes OK, not sure what is happening to cause this. Any ideas?

Well, pretty clear that the call to DBConnection.closeConnection() is hanging. You could confirm this by pressing control-break in the DOS window the next time this happens - you should see a stack trace, and you should find this call in progress.

Thanks for the reply. I tried doing a control-break in the DOS prompt, and it didn't do anything. I also removed the code that closes the connection to see if that is what was hanging, and ran the app again, and it still doesn't close out. What are some reasons why the close to the connection would be hanging? If it was the close statement hanging, why didn't it come back when I took out that code? Am I closing the connection the wrong way? It hangs everytime that I run the app now, only way to not get it to hang is to restart the PC. Also, right now, I am getting the (static)connection from the DB2connection class everytime I call a stored procedure. After getting my data, I am closing out the CallableStatement (I was told before the statement should close the result set so I didn't need to call close on the ResultSet as well), and I only call close on the acutal connection to the DB when the user exits the application. Is this correct, or should I close the connection to the DB after each stored procedure is called? Thanks again! [ August 16, 2003: Message edited by: Jennifer Sohl ] [ August 16, 2003: Message edited by: Jennifer Sohl ]