You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Sa...@innovations.de on 2010/02/01 10:18:27 UTC

Recovering open-scoped lock tokens

Hi all,

 

when I lock a node in jackrabbit (open-scoped) a lock token is returned.
When I login to jackrabbit again (new session) I must put the former
lock token to the session, so the user can unlock the node. What can I
do if I have lost the lock token from jackrabbit. I do not get the lock
token again if I call node.getLockToken(). Is there a recovering
possibility?

 

Thanks in advance

 

Sascha


Re: How to see more repository information than the standalone WAR application shows?

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Feb 2, 2010 at 11:25, Niu, Xuetao <Xu...@fiserv.com> wrote:
> I am using Jackrabbit2.0.0 standalone WAR in Tomcat6. But all I can see
> from url:
> http://localhost:8080/jackrabbit-webapp-2.0.0/repository/default/
> is only the unversioned node tree. I want to see also the properties of
> each node and the versioning tree, my versionable note is /rtde:data
>
> Is there a code-free way?

The version tree is exposed via /jcr:system/jcr:versionStorage when
accessed via the JCR API, but I think the /jcr:system node is excluded
in the webdav views.

If you need a generic JCR browser tool, have a look at
http://wiki.apache.org/jackrabbit/JcrLinks#Open_Source_Tools_and_Libraries

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

How to see more repository information than the standalone WAR application shows?

Posted by "Niu, Xuetao" <Xu...@fiserv.com>.
Hello,

I am using Jackrabbit2.0.0 standalone WAR in Tomcat6. But all I can see
from url:
http://localhost:8080/jackrabbit-webapp-2.0.0/repository/default/
is only the unversioned node tree. I want to see also the properties of
each node and the versioning tree, my versionable note is /rtde:data

Is there a code-free way?

Thanks in advance,
Xuetao

Re: Recovering open-scoped lock tokens

Posted by Paco Avila <mo...@gmail.com>.
Well, there is an obscure way: to have to generate a new lock token
for the locked node and add it to the user session.

	public static String getLockToken(String id) {
		StringBuffer buf = new StringBuffer();
		buf.append(id.toString());
		buf.append('-');
		buf.append(getCheckDigit(id.toString()));
		return buf.toString();
	}

	private static char getCheckDigit(String uuid) {
        int result = 0;

        int multiplier = 36;
        for (int i = 0; i < uuid.length(); i++) {
            char c = uuid.charAt(i);
            if (c >= '0' && c <= '9') {
                int num = c - '0';
                result += multiplier * num;
                multiplier--;
            } else if (c >= 'A' && c <= 'F') {
                int num = c - 'A' + 10;
                result += multiplier * num;
                multiplier--;
            } else if (c >= 'a' && c <= 'f') {
                int num = c - 'a' + 10;
                result += multiplier * num;
                multiplier--;
            }
        }

        int rem = result % 37;
        if (rem != 0) {
            rem = 37 - rem;
        }
        if (rem >= 0 && rem <= 9) {
            return (char) ('0' + rem);
        } else if (rem >= 10 && rem <= 35) {
            return (char) ('A' + rem - 10);
        } else {
            return '+';
        }
    }

2010/2/2  <Sa...@innovations.de>:
> Nobody an idea?
>
> -----Ursprüngliche Nachricht-----
> Von: Sascha.Theves@innovations.de [mailto:Sascha.Theves@innovations.de]
> Gesendet: Montag, 1. Februar 2010 10:18
> An: users@jackrabbit.apache.org
> Betreff: Recovering open-scoped lock tokens
>
> Hi all,
>
>
>
> when I lock a node in jackrabbit (open-scoped) a lock token is returned.
> When I login to jackrabbit again (new session) I must put the former
> lock token to the session, so the user can unlock the node. What can I
> do if I have lost the lock token from jackrabbit. I do not get the lock
> token again if I call node.getLockToken(). Is there a recovering
> possibility?
>
>
>
> Thanks in advance
>
>
>
> Sascha
>
>



-- 
OpenKM
http://www.openkm.com
http://www.guia-ubuntu.org

AW: Recovering open-scoped lock tokens

Posted by KÖLL Claus <C....@TIROL.GV.AT>.
hi,

>Can you please give more details about how to delete the uid in the locks files?
in every workspace there is a locks file and in it there are the uuid's which are locked 
sample: 50561999-0056-4f27-aae1-02ec0b7f98a5-3
so the uid is 50561999-0056-4f27-aae1-02ec0b7f98a5

>I did not understand how exactly did you manage to solve this issue.
At the moment there is no good way to handle this problem ..

>I am using Jackrabbit 2.0.0 as repository, and i also have trouble in
>remembering the lock token for a file after the session is closed.
>I thought about setting the lock token as a custom property for a file (with
>PROPPATCH) in order to be able to find it after a new session start. Do you
>think that is a good idea?
Hmm .. yes you can store it as property .. i store it in the db in addition to the technical data

greets
claus


Re: AW: Recovering open-scoped lock tokens

Posted by Linu <li...@yahoo.com>.
Can you please give more details about how to delete the uid in the locks
files?
I did not understand how exactly did you manage to solve this issue.
I am using Jackrabbit 2.0.0 as repository, and i also have trouble in
remembering the lock token for a file after the session is closed.
I thought about setting the lock token as a custom property for a file (with
PROPPATCH) in order to be able to find it after a new session start. Do you
think that is a good idea?
-- 
View this message in context: http://n4.nabble.com/Recovering-open-scoped-lock-tokens-tp1458577p1471624.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

AW: Recovering open-scoped lock tokens

Posted by Sa...@innovations.de.
Hi,

thanks for your replies. It helped!

Regards

Sascha

-----Ursprüngliche Nachricht-----
Von: KÖLL Claus [mailto:C.KOELL@TIROL.GV.AT] 
Gesendet: Dienstag, 2. Februar 2010 13:07
An: users@jackrabbit.apache.org
Betreff: AW: Recovering open-scoped lock tokens

Hi,

The only way at the moment is to delete the uid in the locks file.
You should stop the repsoitory before deleting :-)

greets
claus

-----Ursprüngliche Nachricht-----
Von: Sascha.Theves@innovations.de [mailto:Sascha.Theves@innovations.de] 
Gesendet: Dienstag, 02. Februar 2010 12:20
An: users@jackrabbit.apache.org
Betreff: AW: Recovering open-scoped lock tokens

Nobody an idea?

-----Ursprüngliche Nachricht-----
Von: Sascha.Theves@innovations.de [mailto:Sascha.Theves@innovations.de] 
Gesendet: Montag, 1. Februar 2010 10:18
An: users@jackrabbit.apache.org
Betreff: Recovering open-scoped lock tokens

Hi all,

 

when I lock a node in jackrabbit (open-scoped) a lock token is returned.
When I login to jackrabbit again (new session) I must put the former
lock token to the session, so the user can unlock the node. What can I
do if I have lost the lock token from jackrabbit. I do not get the lock
token again if I call node.getLockToken(). Is there a recovering
possibility?

 

Thanks in advance

 

Sascha


Re: Jackrabbit2.0.0: Why local file system is needed when I just want to use database?

Posted by Guo Du <mr...@gmail.com>.
> Would anyone be so kind to tell me why Jackrabbit requires a homeDir on
> my file system though I am using database filesystem and database bundle
> persistence?
There are two type of local storage for default configuration: data and index.
Data is stored in db and some big binary node stored in local file
system (which could configured to store everything in db).
Index is used by lucene which could only be on file system.


> If I deploy my application in multiple application servers, can they
> physically share the same homeDir on a network drive?
You may look for cluster deployment:
http://wiki.apache.org/jackrabbit/Clustering


> If not, should each homeDir be only accessed by one single JVM? Like,
> putting the dir in $user.home$ of each machine?
Data could be only used by single JVM,
Index could be read from multi jvm and write from one jvm.

> Is there a way to construct/retrieve jackrabbit repository instance
> without a configuration file on disk? How about from an input stream?
You could with some coding, see following classes for more details:
org.apache.jackrabbit.core.config.RepositoryConfig
org.apache.jackrabbit.core.TransientRepository(final RepositoryConfig config)

-Guo

Jackrabbit2.0.0: Why local file system is needed when I just want to use database?

Posted by "Niu, Xuetao" <Xu...@fiserv.com>.
Hello,

Would anyone be so kind to tell me why Jackrabbit requires a homeDir on
my file system though I am using database filesystem and database bundle
persistence? 

If I deploy my application in multiple application servers, can they
physically share the same homeDir on a network drive? 

If not, should each homeDir be only accessed by one single JVM? Like,
putting the dir in $user.home$ of each machine?

Is there a way to construct/retrieve jackrabbit repository instance
without a configuration file on disk? How about from an input stream?

Thanks in advance!

Xuetao

Re: Multi-indexing growing?

Posted by Alexander Klimetschek <ak...@day.com>.
On Tue, Feb 2, 2010 at 11:32, Niu, Xuetao <Xu...@fiserv.com> wrote:
> Hello,
>
> I delete my versionable root node /rtde:data as well as the homeDir
> everytime the application starts. But I see the Multi-Index logs growing
> each time.
>
> INFO  MultiIndex - indexing...
> /jcr:system/jcr:versionStorage/b3/35/8e/b3358ed8-a1f5-4d42-8451-8522deee
> 8548/jcr:rootVersion (4500)
> INFO  MultiIndex - indexing...
> /jcr:system/jcr:versionStorage/3e/7a/98/3e7a985d-6868-4d5c-b06b-5743c640
> 2434/jcr:versionLabels (4600)
> INFO  MultiIndex - indexing...
> /jcr:system/jcr:versionStorage/b5/88/c4/b588c475-f744-402d-ad52-fd03a845
> 1c64/1.0/jcr:frozenNode/tenant:_100/env:_env (4700)
> INFO  MultiIndex - indexing... /jcr:system/jcr:versionStorage/55/cc/ec
> (4800)
> INFO  MultiIndex - indexing...
> /jcr:system/jcr:versionStorage/b7/69/ee/b769ee98-aef4-4f3a-8656-adcc0d70
> a34e/1.1/jcr:frozenNode/tenant:_100 (4900)
> INFO  MultiIndex - indexing... /jcr:system/jcr:versionStorage/93/74/43
> (5000)
> INFO  LRUNodeIdCache - num=0/10240 hits=0 miss=80000
>
> Why is this? It supposes to be an empty workspace each time.
>
> Can I disable multi-indexing? And what would be the consequence be?

The "MultiIndex" you see in the logs is the lucene index used for the
JCR query implementation. It will not grow endlessly, if nodes get
removed, it will get smaller (not necessarily immediatly, afaik,
because it might do that on a later merge).

But in your case you have versions left over in the version tree,
which is normal. If you delete a node, it's versions are not deleted
automatically. That's the purpose of keeping old versions ;-) To
explicitly get rid of the version tree, see
http://markmail.org/message/4iflkzjxusrpj4ks and
http://issues.apache.org/jira/browse/JCR-134 for some hints.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Multi-indexing growing?

Posted by "Niu, Xuetao" <Xu...@fiserv.com>.
Hello,

I delete my versionable root node /rtde:data as well as the homeDir
everytime the application starts. But I see the Multi-Index logs growing
each time. 

INFO  MultiIndex - indexing...
/jcr:system/jcr:versionStorage/b3/35/8e/b3358ed8-a1f5-4d42-8451-8522deee
8548/jcr:rootVersion (4500)
INFO  MultiIndex - indexing...
/jcr:system/jcr:versionStorage/3e/7a/98/3e7a985d-6868-4d5c-b06b-5743c640
2434/jcr:versionLabels (4600)
INFO  MultiIndex - indexing...
/jcr:system/jcr:versionStorage/b5/88/c4/b588c475-f744-402d-ad52-fd03a845
1c64/1.0/jcr:frozenNode/tenant:_100/env:_env (4700)
INFO  MultiIndex - indexing... /jcr:system/jcr:versionStorage/55/cc/ec
(4800)
INFO  MultiIndex - indexing...
/jcr:system/jcr:versionStorage/b7/69/ee/b769ee98-aef4-4f3a-8656-adcc0d70
a34e/1.1/jcr:frozenNode/tenant:_100 (4900)
INFO  MultiIndex - indexing... /jcr:system/jcr:versionStorage/93/74/43
(5000)
INFO  LRUNodeIdCache - num=0/10240 hits=0 miss=80000

Why is this? It supposes to be an empty workspace each time.

Can I disable multi-indexing? And what would be the consequence be?

Thanks!

Xuetao

AW: Recovering open-scoped lock tokens

Posted by KÖLL Claus <C....@TIROL.GV.AT>.
Hi,

The only way at the moment is to delete the uid in the locks file.
You should stop the repsoitory before deleting :-)

greets
claus

-----Ursprüngliche Nachricht-----
Von: Sascha.Theves@innovations.de [mailto:Sascha.Theves@innovations.de] 
Gesendet: Dienstag, 02. Februar 2010 12:20
An: users@jackrabbit.apache.org
Betreff: AW: Recovering open-scoped lock tokens

Nobody an idea?

-----Ursprüngliche Nachricht-----
Von: Sascha.Theves@innovations.de [mailto:Sascha.Theves@innovations.de] 
Gesendet: Montag, 1. Februar 2010 10:18
An: users@jackrabbit.apache.org
Betreff: Recovering open-scoped lock tokens

Hi all,

 

when I lock a node in jackrabbit (open-scoped) a lock token is returned.
When I login to jackrabbit again (new session) I must put the former
lock token to the session, so the user can unlock the node. What can I
do if I have lost the lock token from jackrabbit. I do not get the lock
token again if I call node.getLockToken(). Is there a recovering
possibility?

 

Thanks in advance

 

Sascha


AW: Recovering open-scoped lock tokens

Posted by Sa...@innovations.de.
Nobody an idea?

-----Ursprüngliche Nachricht-----
Von: Sascha.Theves@innovations.de [mailto:Sascha.Theves@innovations.de] 
Gesendet: Montag, 1. Februar 2010 10:18
An: users@jackrabbit.apache.org
Betreff: Recovering open-scoped lock tokens

Hi all,

 

when I lock a node in jackrabbit (open-scoped) a lock token is returned.
When I login to jackrabbit again (new session) I must put the former
lock token to the session, so the user can unlock the node. What can I
do if I have lost the lock token from jackrabbit. I do not get the lock
token again if I call node.getLockToken(). Is there a recovering
possibility?

 

Thanks in advance

 

Sascha