Page 1 of 1

difference between create() and createSimple()

PostPosted:Tue Mar 29, 2011 12:24 pm
by mike_m
Hola!

Is there any Repository Related difference between create() and createSimple() in OKMDocument rather than parameters?

Do they work the same considering the repository?

Which method is used on FileUploader utility you provide??


Thank you very much

mix

Re: difference between create() and createSimple()

PostPosted:Wed Mar 30, 2011 10:27 am
by pavila
Let's see both methods definition:
Code: Select all
Document create(String token, Document doc, byte[] content)
Document createSimple(String token, String docPath, byte[] content)
The difference is in the second parameter: in "createSimple" only you need to provide a path where the document should be stored. In "create" you have to provide a Document object (which have many fields).

Re: difference between create() and createSimple()

PostPosted:Wed Mar 30, 2011 10:47 am
by mike_m
Paco

I did notice the difference in method signature even before I post. Of course it is different!
What I ask is if there is any difference in terms of document to repository actions, for example:

create() : makes indexing in the JackRabbit whenever a document is placed.
createSimple(): does NOT index

create() : makes proper document validation (content bytes size to proposed size member,...)
createSimple(): places as is

create() : slow but validates, indexes...
createSimple(): fast but not validates, indexes...

I am asking this question due to the fact that I used the create() in order to upload my local path to the repository. I have built a taxonomy/repository around 20GB and now when I am uploading a file using OpenKM GUI the "indexing file" takes about a minute to complete and most of times Mozilla does not responds and finally crashes...

mix.

Re: difference between create() and createSimple()

PostPosted:Tue Apr 05, 2011 2:04 pm
by pavila
There is no more differences between both methods, the only is Document object vs String document path. This is intended for SOAP clients like PHP where you don't need to create an object and fill its lots of properties. Let's say that is a simplification of the API.

Re: difference between create() and createSimple()

PostPosted:Tue Apr 05, 2011 2:06 pm
by pavila
mike_m wrote:I am asking this question due to the fact that I used the create() in order to upload my local path to the repository. I have built a taxonomy/repository around 20GB and now when I am uploading a file using OpenKM GUI the "indexing file" takes about a minute to complete and most of times Mozilla does not responds and finally crashes...
Does the system have enough assigned memory? Can you see anything in the JBoss log? 20GB is tiny document repository and you shouldn’t have any problems with this amount of documents.

Re: difference between create() and createSimple()

PostPosted:Tue May 03, 2011 4:24 am
by amenti
I am seeing this same issue with both the create() and createSimple() method. Each call now takes 50+ seconds to complete. After inserting the document, I call other webservice methods (such as getOKMProperty().addKeyword(), getOKMPropertyGroup().addGroup() and getOKMPropertyGroup().setProperties()) and they take less than 1 second each.

Ubuntu, 6GB ram, local XFS file system, OpenKM 5.0.2
Files: 117,607
Storage: 12.9 GB
Folders: 530

JBoss Java Opts:
JAVA_OPTS="-Xms2048m -Xmx4096m -XX:PermSize=256m -XX:MaxPermSize=512m -Djava.awt.headless=true"

The JBoss log files are not giving any to alarming. The last few lines read as follows:
Code: Select all
2011-05-02 23:21:09,645 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.LRUNodeIdCache] num=10240/10240 hits=40990 miss=546649010
2011-05-02 23:21:09,694 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.BundleCache] num=1178 mem=8191k max=8192k avg=7120 hits=407505986 miss=139144014
2011-05-02 23:21:10,149 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.LRUNodeIdCache] num=10240/10240 hits=40990 miss=546659010
2011-05-02 23:21:10,202 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.BundleCache] num=1208 mem=8191k max=8192k avg=6943 hits=407513482 miss=139146518
2011-05-02 23:21:10,674 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.LRUNodeIdCache] num=10240/10240 hits=40990 miss=546669010
2011-05-02 23:21:10,727 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.BundleCache] num=1176 mem=8186k max=8192k avg=7128 hits=407520966 miss=139149034
2011-05-02 23:21:11,183 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.LRUNodeIdCache] num=10240/10240 hits=40990 miss=546679010
2011-05-02 23:21:11,232 INFO  [org.apache.jackrabbit.core.persistence.bundle.util.BundleCache] num=1227 mem=8188k max=8192k avg=6834 hits=407528453 miss=139151547
Has anyone else experienced this?

Re: difference between create() and createSimple()

PostPosted:Wed May 04, 2011 9:17 am
by pavila
Upgrade to a more recent OpenKM 5.0.x (latest is 5.0.4) and set in OpenKM.cfg
Code: Select all
user.item.cache=on

Re: difference between create() and createSimple()

PostPosted:Wed May 04, 2011 10:15 pm
by amenti
After upgrading to 5.0.4 and adding the parameter in OpenKM.cfg as mentioned above, the create() webserverice now runs in <= 1 second (awesome!). However, the GWT web interface now encounters this problem immediately following a successfully login:
Code: Select all
2011-05-04 17:11:21,340 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenKM]] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract com.openkm.frontend.client.bean.GWTWorkspace com.openkm.frontend.client.service.OKMWorkspaceService.getUserWorkspace() throws com.openkm.frontend.client.OKMException' threw an unexpected exception:
java.lang.NullPointerException
        at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:188)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException

Re: difference between create() and createSimple()

PostPosted:Thu May 05, 2011 2:07 am
by amenti
After a little searching on this forum, I found the fix/update listed here (http://forum.openkm.com/viewtopic.php?f ... ace#p10457). In summary, some new ldap properties were added in 5.0.4 and needed to be added to the OpenKM.cfg file.

Re: difference between create() and createSimple()

PostPosted:Thu May 05, 2011 7:49 pm
by pavila
So, is the problem is solved, isn't it?