Cayenne
  1. Cayenne
  2. CAY-1542

DI container is not shutting down Cayenne-managed connection pool

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1M2
    • Fix Version/s: 3.1M2
    • Component/s: Core Library
    • Labels:
      None
    • Environment:
      Tomcat 7.0.8, Cayenne 3.1 - trunk build from 01.30.2011

      Description

      Tomcat 7 has nice facilities for tracking resource leaks. When shutting down tomcat that runs a Cayenne webapp similar to our tutorial, with CayenneFilter managing Cayenne resources and org.apache.cayenne.configuration.server.XMLPoolingDataSourceFactory, I get the following messages:

      SEVERE: The web application [/fooweb] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
      Feb 19, 2011 12:44:08 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
      SEVERE: The web application [/fooweb] appears to have started a thread named [PoolManagerCleanup-728981380] but has failed to stop it. This is very likely to create a memory leak.

      Will need to ensure that DI shutdown propagates to XMLPoolingDataSourceFactory and it does the right thing.

        Activity

        Andrus Adamchik created issue -
        Hide
        Andrus Adamchik added a comment -

        not handling the DriverManager leak situation - not quite clear what Cayenne should do about it , as it doesn't know about the scope of a static variable. Besides Tomcat seems to be doing the right thing, and the warning message it prints is just an FYI.

        Show
        Andrus Adamchik added a comment - not handling the DriverManager leak situation - not quite clear what Cayenne should do about it , as it doesn't know about the scope of a static variable. Besides Tomcat seems to be doing the right thing, and the warning message it prints is just an FYI.
        Andrus Adamchik made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Andrus Adamchik added a comment -

        (of course PoolManagerCleanup thread leak is fixed)

        Show
        Andrus Adamchik added a comment - (of course PoolManagerCleanup thread leak is fixed)

          People

          • Assignee:
            Andrus Adamchik
            Reporter:
            Andrus Adamchik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development