In general there are 2 ways you can import/export data: either via JCR's import/export feature using system view or document view, or ModeShape's backup/restore. The former allows only a subset of nodes to be exported/imported - so if you have lots of nodes you can narrow down the scope, while the latter will backup/restore an entire repository. In this case if you have lots of data in your repository the amount of time and memory will be proportionate to the amount of data.
Because we use modeshape 3.7.1, when using modeshape export function, it will cause an infinispan exception orgc overhead limit exceeded. so we export each node data into a zip file. This way is correct in export data function, but when we import this node data into other workspace, it will take long time, so how to improve our performance. (data size 45M including 2400 nodes)
I noticed "Use sessions to create and validate large amounts of content transiently, and then save all changes with one call." in Home - ModeShape 3 - Project Documentation Editor
Can you gei show me how to use this feature.?
That statement merely refers to the fact that when using the JCR API, it's better to save data in batches, rather than one by one. In other words, after you create a new JcrSession you should add/remove/edit multiple nodes within that session before calling session.save(). That will give you better performance than calling session.save after each individual node change.
Note that when you're exporting/importing (i.e. JCR import/export) you have two options:
- use the JcrWorkspace API in which case you don't have any control over the sessions involved in the process (typically ModeShape will create and use 1 single session for the entire import/export operation)
- use the JcrSession API in which case you can control how many sessions you use. For example you may use multiple JcrSessions and import/export with each of them only a sub-path of your node graph.
I try it with your way, but it will cause NullPointException. and if I want to upgrade 3.7.1 to 4.6.0, is it possible? and Hong long it will take??
You can try upgrading from 3.x to 4.x by using backup & restore. You essentially back up your repo in 3.x, create a new 4.x configuration with an empty storage location and restore the backup in 4.x. To create the 3.x backup you need to write a bit code while in 4.x you can do the restore either via code or via the web-explorer or REST services (see Backup and restore - ModeShape 4 - Project Documentation Editor)
The time it takes varies on how much data you have.
Thanks very much, and I think because of cache, when i import my data into worksapce, the system will be very slowly. so I want to close cache temporarily in my code, how to do it???