Return-Path: Delivered-To: apmail-incubator-jackrabbit-dev-archive@www.apache.org Received: (qmail 25393 invoked from network); 9 Dec 2005 09:10:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Dec 2005 09:10:36 -0000 Received: (qmail 28490 invoked by uid 500); 9 Dec 2005 09:10:32 -0000 Mailing-List: contact jackrabbit-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-dev@incubator.apache.org Received: (qmail 28464 invoked by uid 99); 9 Dec 2005 09:10:31 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2005 01:10:31 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id DF40318C for ; Fri, 9 Dec 2005 10:10:09 +0100 (CET) Message-ID: <1101055444.1134119409912.JavaMail.jira@ajax.apache.org> Date: Fri, 9 Dec 2005 10:10:09 +0100 (CET) From: "Jukka Zitting (JIRA)" To: jackrabbit-dev@incubator.apache.org Subject: [jira] Assigned: (JCR-245) Automatic repository shutdown In-Reply-To: <1577007561.1128596872356.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/JCR-245?page=all ] Jukka Zitting reassigned JCR-245: --------------------------------- Assign To: Jukka Zitting > Automatic repository shutdown > ----------------------------- > > Key: JCR-245 > URL: http://issues.apache.org/jira/browse/JCR-245 > Project: Jackrabbit > Type: New Feature > Components: core > Reporter: Jukka Zitting > Assignee: Jukka Zitting > Attachments: TransientRepository.patch > > Currently Jackrabbit relies on two mechanisms for safely shutting down a repository: > 1) client application invoking RepositoryImpl.shutdown(), or > 2) the shutdown hook installed by RepositoryImpl being run > Both of these mechanisms have problems: > 1) The shutdown() method is not a part of the JCR API, thus making the client application depend on a Jackrabbit-specific feature > 2) In some cases the shutdown hook is not properly run (see issues JCR-120 and JCR-233) > I think the JCR spec thinks of the Repository and Session interfaces as being somewhat similar to the JDBC DataSource and Connection interfaces. The Repository instances have no real lifecycle methods while the Session instances have clearly specified login and logout steps. (DataSource.getConnection() = Repository.login(), Session.logout() = Connection.close()) However the Jackrabbit implementation defines an explicit lifecycle for the RepositoryImpl instances. > This causes problems especially for container environments (JNDI, Spring) where it is hard or even impossible to specify a shutdown mechanism for resource factories like the Repository instances. The current solution for such environments is to use a shutdown hook, but as reported this solution does not work perfectly in all cases. > How about if we bound the RepositoryImpl lifecycle to the lifecycles of the instantiated Sessions. A RepositoryImpl instance could initialize (and lock) the repository when the first session is opened and automatically shut down when the last session has logged out. As long as the sessions are properly logged out (or finalized by the garbage collector) there would be no need for an explicitly RepositoryImpl.shutdown() call. The current behaviour of pre-initializing the repository and shutting down during a shutdown hook could be enabled with a configuration option for environments (like global JNDI resources) in which the shutdown hooks work well. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira