jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: remove JackrabbitRepository.shutdown()
Date Wed, 16 Apr 2008 05:08:41 GMT
On Tue, Apr 15, 2008 at 6:14 PM, Thomas Mueller
<thomas.tom.mueller@gmail.com> wrote:
>  >  how would you do it with a relational database using JDBC?
>
>  Connection conn = DriverManager.getConnection(...);
>  if (url.startsWith("jdbc:hsqldb:")) {
>     conn.createStatement().execute("SHUTDOWN");
>  }
>  conn.close();
>  ... backup ...
>  Connection conn = DriverManager.getConnection(...);
>  ...
>
>  There is no vendor specific import. The 'SHUTDOWN' statement is vendor
>  specific, but uses the standard JDBC API. Using a JDBC wrapper is not
>  a problem.

If you really needed that, you could always implement
repository.login("SHUTDOWN")... But just like you can't do that to an
Oracle database, I don't think it makes that much sense for
Jackrabbit.

>  >  I don't think the above use case is something that really needs to be
>  >  vendor-independent, i.e. how often a generic application needs to do
>  >  that?
>
>  Do you mean how often does an application need to backup data? It
>  depends on the use case.

Much more specifically: needs to shutdown a repository to backup the
underlying storage. If you need to do that, you're in any case tied to
implementation-specific functionality as already the "backup
underlying storage" requires implementation-specific knowledge. So
IMHO there's not much benefit for the "shutdown the repository" part
to be independent of the underlying implementation.

>  Another use case:
>  http://jackrabbit.apache.org/deployment-models.html
>  Model 1: The (Web-) Application Bundle
>  "The individual repository instances are started and stopped with
>  their containing applications"
>  How should a standalone application close a repository before the
>  application ends, without importing Jackrabbit specific classes?
>  Hopefully this is defined in JCR 2.0.

In model 1 you're embedding the repository and thus you'd have a
direct dependency to jackrabbit-core and use RepositoryImpl.create()
to start the repository up. Using RepositoryImpl.shutdown() to shut it
down doesn't make things any more complicated.

BR,

Jukka Zitting

Mime
View raw message