cancel
Showing results for 
Search instead for 
Did you mean: 

JCR API takes too much time for creating a node..

sashikumar
Champ in-the-making
Champ in-the-making
We are using alfresco for content storage . When we do performance engineering through wily it takes 4.2 seconds for creation of asset in the asset repository. The code is very JCR specific. It takes much of time in




contentNode.checkin();
contentNode.save();
session.save();


Has anyone seen better progress using the Alfresco specific API? Or is there a way to better structure the code when using JCR API?
3 REPLIES 3

kevinr
Star Contributor
Star Contributor
What kind of document are you saving? Is it being indexed - that is probably what is taking the time, you could enable background indexing for that type.

What version of Alfresco are you using? Indexing and the JCR API are faster in 1.3 and will be even quicker in 1.4.

Please provide more information on your setup and test structure.

Thanks,

Kevin

sashikumar
Champ in-the-making
Champ in-the-making
We are saving all types of document say mostly images. Can you pls tell the steps how to enable background indexing.

Alfresco 1.2.1 version is used & JCR version is 1.0 . 

Environment setup is jboss 4.0 ,jdk1.5,imagemagick6.0 & mysql 5.0.

Thanks
Sashi

kevinr
Star Contributor
Star Contributor
There have been a lot of significant performance improvements around JCR-170 and indexing since Alfresco 1.2. I would strongly suggest you try and upgrade to a more recent version of Alfresco.

The Alfresco native APIs are considerably more performant than the JCR-170 APIs - which are a layer on top of the native APIs.

As for background indexing - the model defines which content properties are indexed automically. So for example, in contentModel.xml the default content type is defined thus:

      <type name="cm:content">
         <title>Content</title>
         <parent>cm:cmobject</parent>
         <archive>true</archive>
         <properties>
            <property name="cm:content">
               <type>d:content</type>
               <mandatory>false</mandatory>
               <!— Index content in the background –>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>false</stored>
                  <tokenised>true</tokenised>
               </index>
            </property>
         </properties>
      </type>

Change the 'atomic' indexing property to false:

                  <atomic>false</atomic>
and the content will no longer be indexed at the same time as upload.

Thanks,

Kevin