How to access the system workspace.
piascikj Apr 11, 2011 9:38 AMI recently started using the SQL2 query syntax and found that in 2.4.0.Final I have to define NodeTypes and PropertyDefinitions for the nodes I will be accessing with Joins. I was able to access the nodes after defining the types with the API using the default workspace, but upon restart I was unable to obtain a result for the same query. I found information in Chapter 7 of the User Guide that said,
Remember to specify the system workspace name for your repositories if dynamically adding or modifying node types. Otherwise, ModeShape will not persist your node type changes.
Is this why my NodeType registration is not lasting between restarts?
I tried repository.login("system"), but received the following exception.
org.modeshape.graph.request.InvalidWorkspaceException: The workspace "system" does not exist in the "JCR Infinispan" federated repository
at org.modeshape.graph.connector.federation.FederatedRepository.getWorkspace(FederatedRepository.java:122)
at org.modeshape.graph.connector.federation.ForkRequestProcessor.getWorkspace(ForkRequestProcessor.java:233)
at org.modeshape.graph.connector.federation.ForkRequestProcessor.process(ForkRequestProcessor.java:1328)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:315)
at org.modeshape.graph.connector.federation.FederatedRepositoryConnection.execute(FederatedRepositoryConnection.java:184)
at org.modeshape.graph.Graph.execute(Graph.java:283)
at org.modeshape.graph.Graph$5.process(Graph.java:226)
at org.modeshape.graph.request.RequestBuilder.verifyWorkspace(RequestBuilder.java:72)
How do I specify the system workspace?
Here is my configuration:
{code:xml}
<configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<!--
Define the JCR repositories
-->
<mode:repositories>
<mode:repository jcr:name="fincayra-repository" mode:source="Infinispan">
<mode:options jcr:primaryType="mode:options">
<systemSourceName jcr:primaryType="mode:option" mode:value="system@Infinispan"/>
</mode:options>
</mode:repository>
</mode:repositories>
<mode:sources jcr:primaryType="nt:unstructured">
<mode:source jcr:name="Infinispan"
mode:classname="org.modeshape.connector.infinispan.InfinispanSource"
mode:description="The fincayra repository source"
mode:defaultworkspaceName="objects">
<mode:predefinedWorkspaceNames>system</mode:predefinedWorkspaceNames>
<mode:predefinedWorkspaceNames>objects</mode:predefinedWorkspaceNames>
<mode:cacheConfigurationName>/grid.xml</mode:cacheConfigurationName>
</mode:source>
</mode:sources>
<mode:clustering clusterName="fincayra-repository-cluster">
<mode:configuration><![CDATA[
<config>
<UDP mcast_addr="${jgroups.udp.mcast_addr:228.6.7.9}"
mcast_port="${jgroups.udp.mcast_port:46656}"
tos="8"
ucast_recv_buf_size="20000000"
ucast_send_buf_size="640000"
mcast_recv_buf_size="25000000"
mcast_send_buf_size="640000"
loopback="true"
discard_incompatible_packets="true"
max_bundle_size="64000"
max_bundle_timeout="30"
ip_ttl="${jgroups.udp.ip_ttl:2}"
enable_bundling="true"
enable_diagnostics="false"
thread_naming_pattern="pl"
thread_pool.enabled="true"
thread_pool.min_threads="2"
thread_pool.max_threads="30"
thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="false"
thread_pool.queue_max_size="100"
thread_pool.rejection_policy="Discard"
oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="2"
oob_thread_pool.max_threads="30"
oob_thread_pool.keep_alive_time="5000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Discard"
/>
<PING timeout="3000" num_initial_members="3"/>
<MERGE2 max_interval="30000" min_interval="10000"/>
<FD_SOCK/>
<FD_ALL/>
<BARRIER />
<pbcast.NAKACK use_stats_for_retransmission="false"
exponential_backoff="0"
use_mcast_xmit="true" gc_lag="0"
retransmit_timeout="300,600,1200"
discard_delivered_msgs="true"/>
<UNICAST timeout="300,600,1200"/>
<pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="1000000"/>
<pbcast.GMS print_local_addr="false" join_timeout="3000" view_bundling="true"/>
<FC max_credits="500000" min_threshold="0.20"/>
<FRAG2 frag_size="60000" />
<pbcast.STREAMING_STATE_TRANSFER/>
<pbcast.FLUSH timeout="0"/>
</config>
]]>
</mode:configuration>
</mode:clustering>
</configuration>
{code}