Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 19597 invoked from network); 24 Jan 2011 15:37:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Jan 2011 15:37:09 -0000 Received: (qmail 11276 invoked by uid 500); 24 Jan 2011 15:37:08 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 11012 invoked by uid 500); 24 Jan 2011 15:37:06 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 10999 invoked by uid 99); 24 Jan 2011 15:37:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jan 2011 15:37:05 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of srojas@indra.es designates 94.126.240.15 as permitted sender) Received: from [94.126.240.15] (HELO mailhost1.indra.es) (94.126.240.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jan 2011 15:37:00 +0000 Received: from Madarrvhub01.indra.es (172.22.204.66) by MADARREDGE02.indra.es (192.168.14.157) with Microsoft SMTP Server (TLS) id 8.2.234.1; Mon, 24 Jan 2011 16:36:23 +0100 Received: from MADARRMAILBOX05.indra.es ([fe80::b993:2845:bc5:1614]) by Madarrvhub01.indra.es ([::1]) with mapi; Mon, 24 Jan 2011 16:36:39 +0100 From: "Rojas Buitrago, Sergio" To: "users@jackrabbit.apache.org" Date: Mon, 24 Jan 2011 16:36:36 +0100 Subject: RE: remove a locked node. Thread-Topic: remove a locked node. Thread-Index: Acu7tsFAXt06GyXWTzy6+Cn2ZD2RNAAJWl3Q Message-ID: References: In-Reply-To: Accept-Language: es-ES Content-Language: es-ES X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: es-ES Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Hi. I have tried to obtain the lockToken when I make lock, but lock.getLockToke= n(); return null. If I have not the lockToken, I don't know how can I access to this lockToke= n later in other session. Thanks. -----Mensaje original----- De: janandith jayawardena [mailto:janandith@gmail.com] Enviado el: lunes, 24 de enero de 2011 12:06 Para: users@jackrabbit.apache.org Asunto: Re: remove a locked node. > I say this because when I try to remove the lock (unlock) with the same > user that created it, but in a different session, the application > Throws a LockException that says: > > javax.jcr.lock.LockException: Node not locked by session: > 1241350d-3e5d-401d-a04d-72351a3886da > > > In, J_OperacionesSesion.getLockManagerPrincipal().lock(ruta, false, false, Long.MAX_VALUE, usuario); you are creating a lock that's not limited to the session. So the lock does not get removed once the session is closed. If you use, J_OperacionesSesion.getLockManagerPrincipal().lock(ruta, false, true, Long.MAX_VALUE, usuario); Then you are creating a lock that will be removed when the session is closed. You have to get the lock token from the session that's' locking the node an= d save it. Then add the token to the other session. Here is a test code to simulate this behavior, https://issues.apache.org/jira/secure/attachment/12469073/OpenScopeLockTest= .java Thanks and regards. > > Sergio. > > > > > -----Mensaje original----- > De: Paco Avila [mailto:monkiki@gmail.com] > Enviado el: viernes, 21 de enero de 2011 16:43 > Para: users@jackrabbit.apache.org > Asunto: Re: remove a locked node. > > See > > http://jackrabbit.apache.org/api/2.1/org/apache/jackrabbit/core/NodeImpl.= html#lock%28boolean,%20boolean%29 > . > > On Fri, Jan 21, 2011 at 2:06 PM, Rojas Buitrago, Sergio >wrote: > > > I'm using jackrabbit 2.1.2. > > > > First, with an user "A" execute this code: > > > > // Bloqueamos el nodo > > > > String ruta =3D nodo.getPath(); > > logger.debug("Obtenido path del nodo original: "= + > > ruta); > > String usuario =3D > > J_OperacionesSesion.getUsuarioAutentificado(); > > logger.debug("Obtenido usuario autentificado: " = + > > usuario); > > > > J_OperacionesSesion.getLockManagerPrincipal().lock(ruta, false, > > false, Long.MAX_VALUE, usuario); > > logger.debug("Nodo original bloqueado"); > > session.save(); > > > > > > In other moment an user "B" execute this code: > > > > nodo.remove(); //this is the locked node > > session.save(); > > > > Thanks and regards. > > > > Sergio Rojas Buitrago > > Desarrollo Software > > Gesti=F3n Documental > > > > Ronda de Toledo s/n > > 13003. Ciudad Real > > Espa=F1a > > T +34 926 27 08 49 > > Ext: 237849 > > > > > > srojas@indra.es > > www.indra.es > > > > > > > > > > -----Mensaje original----- > > De: Paco Avila [mailto:monkiki@gmail.com] > > Enviado el: viernes, 21 de enero de 2011 13:59 > > Para: users@jackrabbit.apache.org > > Asunto: Re: remove a locked node. > > > > Then a exception should be thrown. Which Jackrabbit version are you > using? > > Also helps posting a piece of code which reproduce the issue. > > > > On Fri, Jan 21, 2011 at 1:33 PM, Rojas Buitrago, Sergio > >wrote: > > > > > I know. > > > > > > I'm trying to remove with a user that is not the lock owner. > > > > > > > > > Sergio Rojas Buitrago > > > Desarrollo Software > > > Gesti=F3n Documental > > > > > > Ronda de Toledo s/n > > > 13003. Ciudad Real > > > Espa=F1a > > > T +34 926 27 08 49 > > > Ext: 237849 > > > > > > > > > srojas@indra.es > > > www.indra.es > > > > > > > > > > > > > > > -----Mensaje original----- > > > De: Paco Avila [mailto:monkiki@gmail.com] > > > Enviado el: viernes, 21 de enero de 2011 13:31 > > > Para: users@jackrabbit.apache.org > > > Asunto: Re: remove a locked node. > > > > > > The lock owner can modify the node. > > > > > > On Fri, Jan 21, 2011 at 1:21 PM, Rojas Buitrago, Sergio < > srojas@indra.es > > > >wrote: > > > > > > > Hi all. > > > > > > > > > > > > > > > > I have a problem with the locked nodes. > > > > > > > > > > > > > > > > When I try to remove a locked node, the operation node.remove() > doesn't > > > > throw the LockException. > > > > > > > > > > > > > > > > I supposed that if a node is locked no operations could be realized > > over > > > > the node. > > > > > > > > > > > > > > > > Somebody can help me ? > > > > > > > > > > > > > > > > Thanks and regards. > > > > > > > > > > > > > > > > *Sergio Rojas Buitrago* > > > > Desarrollo Software > > > > Gesti=F3n Documental > > > > > > > > Ronda de Toledo s/n > > > > 13003. Ciudad Real > > > > Espa=F1a > > > > > > > > T +34 926 27 08 49 > > > > > > > > Ext: 237849 > > > > > > > > > > > > > > > > srojas@indra.es > > > > www.indra.es > > > > > > > > [image: indra] > > > > > > > > > > > > > > > > ------------------------------ > > > > Este correo electr=F3nico y, en su caso, cualquier fichero anexo al > > mismo, > > > > contiene informaci=F3n de car=E1cter confidencial exclusivamente di= rigida > a > > > su > > > > destinatario o destinatarios. Si no es vd. el destinatario indicado= , > > > queda > > > > notificado que la lectura, utilizaci=F3n, divulgaci=F3n y/o copia s= in > > > > autorizaci=F3n est=E1 prohibida en virtud de la legislaci=F3n vigen= te. En > el > > > caso > > > > de haber recibido este correo electr=F3nico por error, se ruega > notificar > > > > inmediatamente esta circunstancia mediante reenv=EDo a la direcci= =F3n > > > > electr=F3nica del remitente. > > > > Evite imprimir este mensaje si no es estrictamente necesario. > > > > > > > > This email and any file attached to it (when applicable) contain(s) > > > > confidential information that is exclusively addressed to its > > > recipient(s). > > > > If you are not the indicated recipient, you are informed that > reading, > > > > using, disseminating and/or copying it without authorisation is > > forbidden > > > in > > > > accordance with the legislation in effect. If you have received thi= s > > > email > > > > by mistake, please immediately notify the sender of the situation b= y > > > > resending it to their email address. > > > > Avoid printing this message if it is not absolutely necessary. > > > > > > > > > > > > > > > > -- > > > OpenKM > > > http://www.openkm.com > > > http://www.guia-ubuntu.org > > > > > > Este correo electr=F3nico y, en su caso, cualquier fichero anexo al > mismo, > > > contiene informaci=F3n de car=E1cter confidencial exclusivamente diri= gida a > > su > > > destinatario o destinatarios. Si no es vd. el destinatario indicado, > > queda > > > notificado que la lectura, utilizaci=F3n, divulgaci=F3n y/o copia sin > > > autorizaci=F3n est=E1 prohibida en virtud de la legislaci=F3n vigente= . En el > > caso > > > de haber recibido este correo electr=F3nico por error, se ruega notif= icar > > > inmediatamente esta circunstancia mediante reenv=EDo a la direcci=F3n > > > electr=F3nica del remitente. > > > Evite imprimir este mensaje si no es estrictamente necesario. > > > > > > This email and any file attached to it (when applicable) contain(s) > > > confidential information that is exclusively addressed to its > > recipient(s). > > > If you are not the indicated recipient, you are informed that reading= , > > > using, disseminating and/or copying it without authorisation is > forbidden > > in > > > accordance with the legislation in effect. If you have received this > > email > > > by mistake, please immediately notify the sender of the situation by > > > resending it to their email address. > > > Avoid printing this message if it is not absolutely necessary. > > > > > > > > > > > -- > > OpenKM > > http://www.openkm.com > > http://www.guia-ubuntu.org > > > > Este correo electr=F3nico y, en su caso, cualquier fichero anexo al mis= mo, > > contiene informaci=F3n de car=E1cter confidencial exclusivamente dirigi= da a > su > > destinatario o destinatarios. Si no es vd. el destinatario indicado, > queda > > notificado que la lectura, utilizaci=F3n, divulgaci=F3n y/o copia sin > > autorizaci=F3n est=E1 prohibida en virtud de la legislaci=F3n vigente. = En el > caso > > de haber recibido este correo electr=F3nico por error, se ruega notific= ar > > inmediatamente esta circunstancia mediante reenv=EDo a la direcci=F3n > > electr=F3nica del remitente. > > Evite imprimir este mensaje si no es estrictamente necesario. > > > > This email and any file attached to it (when applicable) contain(s) > > confidential information that is exclusively addressed to its > recipient(s). > > If you are not the indicated recipient, you are informed that reading, > > using, disseminating and/or copying it without authorisation is forbidd= en > in > > accordance with the legislation in effect. If you have received this > email > > by mistake, please immediately notify the sender of the situation by > > resending it to their email address. > > Avoid printing this message if it is not absolutely necessary. > > > > > > -- > OpenKM > http://www.openkm.com > http://www.guia-ubuntu.org > > Este correo electr=F3nico y, en su caso, cualquier fichero anexo al mismo= , > contiene informaci=F3n de car=E1cter confidencial exclusivamente dirigida= a su > destinatario o destinatarios. Si no es vd. el destinatario indicado, qued= a > notificado que la lectura, utilizaci=F3n, divulgaci=F3n y/o copia sin > autorizaci=F3n est=E1 prohibida en virtud de la legislaci=F3n vigente. En= el caso > de haber recibido este correo electr=F3nico por error, se ruega notificar > inmediatamente esta circunstancia mediante reenv=EDo a la direcci=F3n > electr=F3nica del remitente. > Evite imprimir este mensaje si no es estrictamente necesario. > > This email and any file attached to it (when applicable) contain(s) > confidential information that is exclusively addressed to its recipient(s= ). > If you are not the indicated recipient, you are informed that reading, > using, disseminating and/or copying it without authorisation is forbidden= in > accordance with the legislation in effect. If you have received this emai= l > by mistake, please immediately notify the sender of the situation by > resending it to their email address. > Avoid printing this message if it is not absolutely necessary. > Este correo electr=F3nico y, en su caso, cualquier fichero anexo al mismo, = contiene informaci=F3n de car=E1cter confidencial exclusivamente dirigida a= su destinatario o destinatarios. Si no es vd. el destinatario indicado, qu= eda notificado que la lectura, utilizaci=F3n, divulgaci=F3n y/o copia sin a= utorizaci=F3n est=E1 prohibida en virtud de la legislaci=F3n vigente. En el= caso de haber recibido este correo electr=F3nico por error, se ruega notif= icar inmediatamente esta circunstancia mediante reenv=EDo a la direcci=F3n = electr=F3nica del remitente. Evite imprimir este mensaje si no es estrictamente necesario. This email and any file attached to it (when applicable) contain(s) confide= ntial information that is exclusively addressed to its recipient(s). If you= are not the indicated recipient, you are informed that reading, using, dis= seminating and/or copying it without authorisation is forbidden in accordan= ce with the legislation in effect. If you have received this email by mista= ke, please immediately notify the sender of the situation by resending it t= o their email address. Avoid printing this message if it is not absolutely necessary.