You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Andrew Jaquith <an...@gmail.com> on 2009/10/25 17:40:24 UTC
Priha shutdown
Hey Janne,
Somewhere in the recent set of changes to Priha, we lost the ability
to restart the repository. The ShutdownThread in RepositoryImpl seems
to be the only way to restart the providers (and by extension the
FileProvider). That breaks the "instant install" feature and
necessitates a container restart.
Any plans to provide a way to restart or re-init Priha? A shutdown()
method in RepositoryImpl would do nicely... :) We could all this from
inside ContentManager.shutdown().
I not fond of special-casing this kind of stuff, but still...
Andrew
Re: Priha shutdown
Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> One thing I've noticed in recent Priha builds is that it checks for a
> lockfile to ensure exclusive use. That is a good idea, but it's meant
> I had to hunt down and kill a few stray WikiEngine references in unit
> tests that didn't call WikiEngine.shutdown(). Easily done once I knew
> what to look for.
Yeah, the lockfile is quite mandatory; it would be too easy to get
file corruption otherwise. Priha JdbcProvider does not actually
create this lockfile; instead, it assumes that the underlying database
is smart enough to handle concurrent access. So this behaviour is
specific to the FileProvider.
/Janne
Re: Priha shutdown
Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> Just like with SQL, such methods aren't in the JCR standard. Do we
> check
> whether we're really using Priha while calling this method?
Yeah, kind of. There's a bit of wonky code in
ContentManager.shutdown() which uses reflection to call the shutdown()
method, but it should work roughly similarly for all Repository
implementations which implement shutdown().
My guess is that this will fail with Alfresco and some other tools
though...
> Hmm, doesn't that sound like using a singleton would be the way to go?
Using a singleton (and accessing it through JNDI) is one possible
deployment method, yes, but it does not protect against two JVMs
accessing the same physical file system and directory. That's why the
lockfile.
/Janne
Re: Priha shutdown
Posted by Florian Holeczek <fl...@holeczek.de>.
Hi Andrew,
just a few quick notes without having looked into the code...
> Just checked 0.5.5 in. The shutdown() method works as advertised -- thanks!
Just like with SQL, such methods aren't in the JCR standard. Do we check
whether we're really using Priha while calling this method?
> One thing I've noticed in recent Priha builds is that it checks for a
> lockfile to ensure exclusive use. That is a good idea, but it's meant
> I had to hunt down and kill a few stray WikiEngine references in unit
> tests that didn't call WikiEngine.shutdown(). Easily done once I knew
> what to look for.
Hmm, doesn't that sound like using a singleton would be the way to go?
Regards
Florian
Re: Priha shutdown
Posted by Andrew Jaquith <an...@gmail.com>.
Just checked 0.5.5 in. The shutdown() method works as advertised -- thanks!
Also scrubbed the schema directory from the trunk, so the licensing
question is all gone now.
One thing I've noticed in recent Priha builds is that it checks for a
lockfile to ensure exclusive use. That is a good idea, but it's meant
I had to hunt down and kill a few stray WikiEngine references in unit
tests that didn't call WikiEngine.shutdown(). Easily done once I knew
what to look for.
Andrew
On Sun, Oct 25, 2009 at 3:39 PM, Janne Jalkanen
<Ja...@ecyrd.com> wrote:
>
> On Oct 25, 2009, at 18:40 , Andrew Jaquith wrote:
>
>> Hey Janne,
>>
>> Somewhere in the recent set of changes to Priha, we lost the ability
>> to restart the repository. The ShutdownThread in RepositoryImpl seems
>> to be the only way to restart the providers (and by extension the
>> FileProvider). That breaks the "instant install" feature and
>> necessitates a container restart.
>>
>> Any plans to provide a way to restart or re-init Priha? A shutdown()
>> method in RepositoryImpl would do nicely... :) We could all this from
>> inside ContentManager.shutdown().
>>
>> I not fond of special-casing this kind of stuff, but still...
>
> Well, Jackrabbit offers this method as well for some repository types. It
> can create a lot of problems in case the repository is shared across
> multiple instances. However, in this case it makes sense...
>
> SVN trunk now has the shutdown() method.
>
> /Janne
>
Re: Priha shutdown
Posted by Janne Jalkanen <Ja...@ecyrd.com>.
On Oct 25, 2009, at 18:40 , Andrew Jaquith wrote:
> Hey Janne,
>
> Somewhere in the recent set of changes to Priha, we lost the ability
> to restart the repository. The ShutdownThread in RepositoryImpl seems
> to be the only way to restart the providers (and by extension the
> FileProvider). That breaks the "instant install" feature and
> necessitates a container restart.
>
> Any plans to provide a way to restart or re-init Priha? A shutdown()
> method in RepositoryImpl would do nicely... :) We could all this from
> inside ContentManager.shutdown().
>
> I not fond of special-casing this kind of stuff, but still...
Well, Jackrabbit offers this method as well for some repository
types. It can create a lot of problems in case the repository is
shared across multiple instances. However, in this case it makes
sense...
SVN trunk now has the shutdown() method.
/Janne