Justin Edelson | 1 Feb 2012 01:11
Gravatar

Re: maven, poms, etc

Robert-
You might want to take a look at the Sling Maven Archetypes
(http://sling.apache.org/site/maven-archetypes.html). These provide a
baseline for JCR/Sling OSGi bundle development.

HTH,
Justin

On Tue, Jan 31, 2012 at 11:13 AM, Robert A. Decker <decker <at> robdecker.com> wrote:
> Hi,
>
> I normally work with CQ but I would like to try some development under
> jackrabbit.
>
> Do I work with it in the same way that I do development with CQ? IOW, I have
> an instance running, and I do my development of my bundles in
> eclipse/intellij and I have some settings in my POMS that uses the
> maven-sling-plugin to install the bundles... And I use the maven-scr-plugin
> for annotations...
>
> How different is development in jackrabbit from development in cq? I know
> that I'll lose the crx apis and the com.day.cq apis... Do I lose adaptTo?
>
> I hate to ask it, but does anyone have a very basic pom for jackrabbit
> development that I can look at? (not for building jackrabbit but instead for
> just some bundle development)
>
>
> Rob

(Continue reading)

goutham_pn | 3 Feb 2012 08:18
Picon

Jackrabbit Cluster - Document Not Found

Hello All,

We are developing a multi tenant application where we have got 4 tenants
each using separate workspace. (Thought its not a best practice).

As in Wiki(http://wiki.apache.org/jackrabbit/Clustering) I have configured
the application in clustered environment.

We have got 4 portals(each portal acting a cluster-node) where 2 portals can
add/delete(portal1 and portal2) but the other 2 can just read the
documents(portal3 and portal4).

For 3 tenants its working fine but for 4th tenant If I add a document in
portal1 its not seen in portal2 and if add a document in portal2 its not
seen by any other portals. Only documents added by portal1 is seen in
portal3 and portal4(which has read permissions).

The porblem is for only 1 tenant other tenants are working fine.

Could anyone help us on this.

-----
Thanks & Regards,
Goutham PN
--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Cluster-Document-Not-Found-tp4353874p4353874.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Kevin Müller | 3 Feb 2012 10:51
Picon
Favicon

AW: Bulk load of several nodes

Are there any plans to maybe extend this in near future ?
When you have a Lucene query that should return some properties, you get 100 hits and none were cached I think
it can make quite a difference performance-wise if there will be 100 DB queries or 1, couldn't it ?

Regards, Kevin

-----Ursprüngliche Nachricht-----
Von: Alexander Klimetschek [mailto:aklimets <at> adobe.com] 
Gesendet: Dienstag, 17. Januar 2012 23:54
An: users <at> jackrabbit.apache.org
Betreff: Re: Bulk load of several nodes

On 16.01.12 13:51, "Lukas Kahwe Smith" <mls <at> pooteeweet.org> wrote:
>checkout http://java.net/jira/browse/JSR_333-38
>
>the necessary changes have already been applied in Jackrabbit 2.3.x

I don't know if they actually map to a similar batch method on the
persistence manager (^= database access in the OP case). In any case, it
does not change the situation for jcr queries - the nodes will already be
fetched (individually) when you ask for a row or its path or its node.

The above method was probably introduced for remote clients, such as
JCR-RMI or SPI/dav, which are all way above the persistence manager layer.

Cheers,
Alex

--

-- 
Alexander Klimetschek
(Continue reading)

mslama | 3 Feb 2012 13:13
Picon

XPath query performance question

Hi,

I have following use case:

I have about 2000 company nodes under node companies:
/companies/company[1]
/companies/company[2]
....
/companies/company[N]

I query for one company by property value - exact match, no wildcards. And result should contain just one
node. For example I use query:

//companies/company[ <at> calais='http://d.opencalais.com/er/company/ralg-tr1r/2c970a55-e08d-3af8-ad1d-3c46f341e749']

and then one call of NodeIterator.next to get unique (or first as there is no constraint on uniqueness)
result. So there is no big resultset.

Property 'calais' is string type and when set it is unique ie. small number of company nodes may have this
property either empty or missing. Property value can be up to 100chars long if it can make any difference
for index.

When only one thread is running it takes 100-200ms. When 4 threads are running it is about 500ms on average. I used
profiler with sampling to get some profiling data. I seems to be too much provided that number on nodes is not
that high
and it is using Lucene index. Calls of query.execute and nodeIterator.next take both about the same time.
When I checked thread dumps it uses Lucene index so it does not look like it scans all nodes.

Question: Is there any way how speedup this kind of lookup? The only way I found so far is to incorporate the
most often property used for lookup to node path as session.getNode(path) is much faster.
(Continue reading)

Alessandro | 3 Feb 2012 16:11
Picon

Re: XPath query performance question

If you were running the query without path restrictions, would it return more than one node? In other words,
outside the /companies tree, are there other company nodes with the same calais attribute value?
Results are generated from the predicate, and then filtered by the path.

Alessandro 

On Feb 3, 2012, at 7:13 AM, mslama <at> email.cz wrote:

> Hi,
> 
> I have following use case:
> 
> I have about 2000 company nodes under node companies:
> /companies/company[1]
> /companies/company[2]
> ....
> /companies/company[N]
> 
> I query for one company by property value - exact match, no wildcards. And result should contain just one
node. For example I use query:
> 
> //companies/company[ <at> calais='http://d.opencalais.com/er/company/ralg-tr1r/2c970a55-e08d-3af8-ad1d-3c46f341e749']
> 
> and then one call of NodeIterator.next to get unique (or first as there is no constraint on uniqueness)
result. So there is no big resultset.
> 
> Property 'calais' is string type and when set it is unique ie. small number of company nodes may have this
property either empty or missing. Property value can be up to 100chars long if it can make any difference
for index.
> 
(Continue reading)

mslama | 3 Feb 2012 16:24
Picon

Re: Re: XPath query performance question


No property 'calais' is not used anywhere else. So if I use query without path info it will return the same result.

Marek

> ------------ Původní zpráva ------------
> Od: Alessandro <alessandro.bologna <at> gmail.com>
> Předmět: Re: XPath query performance question
> Datum: 03.2.2012 16:12:15
> ----------------------------------------
> If you were running the query without path restrictions, would it return more
> than one node? In other words, outside the /companies tree, are there other
> company nodes with the same calais attribute value?
> Results are generated from the predicate, and then filtered by the path.
> 
> Alessandro 
> 
> On Feb 3, 2012, at 7:13 AM, mslama <at> email.cz wrote:
> 
> > Hi,
> > 
> > I have following use case:
> > 
> > I have about 2000 company nodes under node companies:
> > /companies/company[1]
> > /companies/company[2]
> > ....
> > /companies/company[N]
> > 
> > I query for one company by property value - exact match, no wildcards. And
(Continue reading)

mslama | 3 Feb 2012 16:51
Picon

Re: Re: Re: XPath query performance question

Ok. I tried

//*[ <at> calais='http://d.opencalais.com/er/company/ralg-tr1r/2a2094a9-9a0b-3fb6-bb51-0c9e940deaaf']

instead of original

//companies/company[ <at> calais='http://d.opencalais.com/er/company/ralg-tr1r/2a2094a9-9a0b-3fb6-bb51-0c9e940deaaf']

and now query.execute+nodeIterator.getNext is 10times faster. (As property names we use are unique I can
use //* and get the same result. I must say it is quite unintuitive behaviour. Hopefully it will help others too.)

Thanks for hint

Marek/
> ------------ Původní zpráva ------------
> Od:  <mslama <at> email.cz>
> Předmět: Re: Re: XPath query performance question
> Datum: 03.2.2012 16:25:07
> ----------------------------------------
> 
> No property 'calais' is not used anywhere else. So if I use query without path
> info it will return the same result.
> 
> Marek
> 
> > ------------ Původní zpráva ------------
> > Od: Alessandro <alessandro.bologna <at> gmail.com>
> > Předmět: Re: XPath query performance question
> > Datum: 03.2.2012 16:12:15
> > ----------------------------------------
(Continue reading)

ABAM | 3 Feb 2012 19:05
Picon
Favicon

se-jcr issue with jackrabbit

Hi Salvatore

I am triyin to use se-jcr with out succes let me explain to you.

What I have?
I have a Spring MVC 3.1, Jackrabbit 2 (jcr 283)
Now I am using JCR but I am using it in the controller like follow:

repository =
RepositoryAccessServlet.getRepository(request.getSession().getServletContext();
jcrSession = repository.login(new
SimpleCredentials("admin","admin".toCharArray()));

What I like to do?

In order to follow a good MVC architecture I like to make all the jackrabbit
interaction in the DAO layer and not in the controller layer, there is where
I need se-jcr.

Like is not a good idea to sent the session from the controller to the
services and from the services to the DAO I like to get the session in the
DAO like follow:

web.XML first context-param

<context-param>
	<param-name>contextConfigLocation</param-name>
	<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

(Continue reading)

mslama | 6 Feb 2012 16:07
Picon

Any way how to remove node lock?

Hi,

I experimented with node locking. I am under JBoss with XATransaction and if I understand this correctly it
means it has now container managed transactions which means transaction starts when I create new session
and end on session logout.

To make lock visible to another session I used:
newSession
lock Node
session logout

newSession
modifyNode
unlock Node
session logout

I just found that I have to transfer lock token so fixed version is:
newSession
lock Node
get lock token
session logout

newSession
add lock token
modifyNode
unlock Node
session logout

Is it correct? But from my first incorrect test I have now some locked nodes. Is there any wahy how to remove locks
from nodes?
(Continue reading)

Mark Herman | 6 Feb 2012 16:14
Favicon

Re: Any way how to remove node lock?


mslama wrote
> 
> 
> But from my first incorrect test I have now some locked nodes. Is there
> any wahy how to remove locks from nodes?
> 
> 

The only way I have found is to log in as the "admin" account.  That seems
to be able to clean up the locks without following the normal rules.  

FYI, you also have to be careful about not logging out. I found that if
somewhere you have code that doesn't result in a logout() or you get a hard
crash, that session will remain and even if you know the lock token, JR
won't let you add it to a 2nd session.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/Any-way-how-to-remove-node-lock-tp4361516p4361534.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Gmane