As you've said yourself already, you're much better off using a single connection, but that doesn't explain why it hung. The Developer's Guide has a section on logging. Would you please enable DEBUG level logging and post the last part of the log. Also, the source code is included in the distribution so you could try and compile it with your application and use the debugger to investigate the hanging behavior.
- Hans (EDT)