-
1. Re: Restore jcr node to another repository
rhauch Jul 25, 2012 12:03 PM (in response to oranjedog)1 of 1 people found this helpfulCloning information from one repository to another repository is beyond the scope of the JCR specification and APIs. So if you do work with two repositories, you'll not have much choice than to either programmatically walk the content in the first repository and copy the information into the second.
However, with ModeShape it is possible to use federation to define a single repository that uses multiple sources. See the chapter in our ModeShape 2.x documentation that covers the Federation Connector.
Perhaps the easiest and most common way is to define one workspace to use one source, and other workspaces to use other sources. For example, you could define one workspace (e.g., "live-metadata") to use the JDBC Metadata Connector, and another workspace to use the JPA Connector (or whichever persisting connector you choose). Thus, you could use JCR's Workspace.clone(...) methods to implement the copy operation. (We have a configuration file in our integration tests that shows how this can be done.)
Hope that helps!
-
2. Re: Restore jcr node to another repository
oranjedog Jul 25, 2012 10:32 PM (in response to rhauch)Thank you for your reply, I will give it a try. I've a further question, in the jpa test code in the integration test project, when a node add a new node and session save it, modeshape will add node into table in the db and users will dont know the tables' name and structure,right?
-
3. Re: Restore jcr node to another repository
rhauch Jul 26, 2012 9:02 AM (in response to oranjedog)1 of 1 people found this helpfulHow and where ModeShape persists information is completely transparent to users of the JCR API. So, yes, when nodes are added/changed/removed and saved, ModeShape will then insert/udpate/delete rows in the database tables.
-
4. Re: Restore jcr node to another repository
oranjedog Jul 27, 2012 4:42 AM (in response to rhauch)Get it. One more question, if there are a lot of tables in one schema, how about the performance with the JCR node? Thanks.
-
5. Re: Restore jcr node to another repository
hchiorean Jul 27, 2012 4:51 AM (in response to oranjedog)ModeShape uses about 8 tables in total for storing it's data, out of which only about 4 are "hit on a regular basis", storing node information. So there isn't really the case of a lot of tables in a schema.
If you have lots of nodes (which will translate into table rows), the performance should be no worse than a simple Hibernate application working with the same tables/rows.
-
6. Re: Restore jcr node to another repository
oranjedog Jul 30, 2012 12:31 PM (in response to hchiorean)Got you...thanks...