Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Testing and JDBC > Verify your tests clean up JDBC resources

10.4. Verify your tests clean up JDBC resources

Problem

You have written some tests that create JDBC objects such as connections, statements, and result sets. You want to avoid leaking resources by ensuring that your tests clean themselves up.

Background

There are a number of problems with leaking JDBC resources. For one, you can easily defeat the purpose of JDBC connection pooling by holding on to connections until the database gives up waiting for you and orphans them, rendering them unusable. This article we found on the Web describes the problem in more detail.[12]

[12] From “WebSpherePro System Admin Tips,” May 28, 2003 issue (www.e-promag.com/epnewsletters). Use search keywords “connection pooling performance”.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial