On Mon, Jul 27, 2009 at 3:56 PM, Ajai<ajaik...@gmail.com> wrote:
>
> Hi Guo,
>
> Yes, i am adding a document to the repository.
> Is there multiple ways to do a save?
>
> I am doing it the following way,
>
> fileNode = matterNode.addNode(fileName, "nt:file");
> fileNode.addMixin("mix:versionable");
> fileNode.addMixin("mix:referenceable");

adding mix:referenceable is redundant since it's already
included through mix:versionable (mix:versionable inherits
from mix:referenceable.

> Node resNode = fileNode.addNode("jcr:content", "nt:resource");
> resNode.addMixin("mix:versionable");
> resNode.addMixin("mix:referenceable");

same here.

btw: why are you making the jcr:content node versionable?
you already made the nt:file node versionable.

cheers
stefan

> resNode.setProperty("jcr:mimeType", mimeType);
> resNode.setProperty("jcr:encoding", ENCODING_UTF_8);
> resNode.setProperty("jcr:data", new FileInputStream(file));
> Calendar lastModified = Calendar.getInstance();
> lastModified.setTimeInMillis(file.lastModified());
> resNode.setProperty("jcr:lastModified", lastModified);
> // finally
> session.save();
>
> Please suggest if any changes can be done.
>
>
> Thanks,
> Ajai G
>
>
> Guo Du wrote:
>>
>>> I tried using the Derby database to upload 375000 Documents.
>>>
>>> When i tried to add a document to this setup. It took more than 30 mins
>>> to
>>> do a checkin,
>>> The system CPU utilization was around 90% to 100% and the JVM heap size
>>> also
>>> is around 1.5GB.
>>
>> When did you check out the document? Are you mean add and save
>> documents to repository?
>>
>> I am not sure how you save the documents. The save  do the actual
>> persistent to db, so you should avoid keep a big change list in your
>> mem before call save.
>>
>> --Guo
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Performance-of-Jackrabbit-tp24619853p24681170.html
> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.
>
>

Reply via email to