cancel
Showing results for 
Search instead for 
Did you mean: 

Add 1 million of documents in the same store

lmoulin
Champ in-the-making
Champ in-the-making
Hello,
I use the following method to add new documents in the base:

RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();       
           
// Create the CML structure
// When executed this cml update query will create a new content node beneth the tutorial folder and the add the
// versionable aspect to the newly created node
ParentReference parentReference = new ParentReference(STORE, null, "/app:company_home/cm:sample_folder", Constants.ASSOC_CONTAINS, Constants.ASSOC_CONTAINS);           
NamedValue[] properties = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, System.currentTimeMillis() + "_WebServiceSample4.txt")};
CMLCreate create = new CMLCreate("id1", parentReference, null, null, null, Constants.TYPE_CONTENT, properties);       
CMLAddAspect addAspect = new CMLAddAspect(Constants.ASPECT_VERSIONABLE, null, null, "id1");
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create});
cml.setAddAspect(new CMLAddAspect[]{addAspect});

// Execute the update
UpdateResult[] updateResults = repositoryService.update(cml);

The source is in alfresco-community-sdk-2.1.0\samples\WebServiceSamples\source\org\alfresco\sample\webservice

But I want to add 1 000 000 documents in the same store.
But the previous is very slow.
It is possible to add documents quickly?
It is possible to not check the folder ACL?

Thanks a lot for your response.
Luc
1 REPLY 1

lmoulin
Champ in-the-making
Champ in-the-making
This line takes 1000ms for each documents.

UpdateResult[] updateResults = repositoryService.update(cml);

Is it possible to accelerate this method?
Thanks a lot