|
|
|
Re: [CDO] Enable Branching [message #666479 is a reply to message #666468] |
Wed, 20 April 2011 14:41 |
|
Am 20.04.2011 16:15, schrieb Philipp H.:
> Hello Eike,
>
> thank you very much for your fast response.
>
>> Are you using the latest service release from http://download.eclipse.org/modeling/emf/cdo/updates/3.0-rel eases ?
> Yes, I do. I use 3.0.0.v20110120-1046 (CDO Model Repository Server). The correspondent version from your update site is just 3.0.0.v20100911-0901. So I think, I'm up to date.
>
>> CDO 4.0 is almost stable now that M7 is approaching. Maybe you want to give it a try?
> Great Hint. I will try it out! :)
>
>> You can not enable branching for databases that have been created without it. Have you started the repository with a fresh database?
> Good point. I deleted the _database-folder created by the CDO Server and changed the repo-Name. But that didn't had any effect on the branch support. If this would be the mistake, the In-Memory-DB (store type mem) should work, since the database is recreated by every restart of the server.
>
>> Can you send the entire config file?
> Sure. It's basically the cdo-server.xml from the tutorial:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cdoServer>
>
> <!--acceptor type="http"/ -->
>
> <acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
> <!-- negotiator type="challenge" description="/temp/users.db"/ -->
> </acceptor>
>
> <repository name="repo1">
> <property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
> <property name="supportingAudits" value="true"/>
> <property name="verifyingRevisions" value="false"/>
> <property name="currentLRUCapacity" value="10000"/>
> <property name="revisedLRUCapacity" value="100"/>
The last 3 are deprecated and ignored.
>
> <!-- selbst hinzugefügt: -->
> <property name="supportingBranches" values="true"/>
> <!--<property name="supportingEcore" values="true"/>--> <!-- Legacy-Mode -->
>
> <store type="db">
> <mappingStrategy type="horizontal">
This mapping strategy has different meanings in 4.0 and 3.0:
- In 3.0 it means "no auditing or branching supported"
- In 4.0 it is a delegating mapping strategy and means "choose the mapping strategy that is adequate for the configured repository properties".
I don't know why the MEMStore had the same problem but with a 3.0 DBStore you'd need to use
<mappingStrategy type="horizontalBranching">
in addition to
<repository name="repo1">
<property name="supportingBranches" values="true"/>
Does that help?
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
> <property name="qualifiedNames" value="false"/>
> <property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE"/>
> <property name="toOneReferences" value="LIKE_ATTRIBUTES"/>
> </mappingStrategy>
>
>
> <dbAdapter name="h2"/>
> <dataSource class="org.h2.jdbcx.JdbcDataSource"
> uRL="jdbc:h2:_database/cdodb1"/>
>
> <!-- <dbAdapter name="derby-embedded"/>
> <dataSource class="org.apache.derby.jdbc.EmbeddedDataSource"
> databaseName="/temp/cdodb1"
> createDatabase="create"/>-->
>
> <!--<dbAdapter name="hsqldb"/>
> <dataSource class="org.eclipse.net4j.db.hsqldb.HSQLDBDataSource" database="jdbc:hsqldb:mem:cdodb1"
> user="sa"/>-->
>
> <!--<dbAdapter name="mysql"/>
> <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" url="jdbc:mysql://localhost/cdodb1"
> user="root"/>-->
>
> <!--<dbAdapter name="postgresql"/>
> <dataSource class="org.postgresql.ds.PGSimpleDataSource"
> url="jdbc:postgresql://localhost:5432/cdo"
> databaseName="cdo"
> user="cdo"
> password="cdo"/>-->
> </store>
> </repository>
> </cdoServer>
>
>> Hard to say with no more context infos. It wold be easier if I could execute your code.
> My test client is absolutely not extraordinary:
>
> IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "tcp://localhost:2036");
>
> CDOSessionConfiguration sessionConfiguration = CDONet4jUtil.createSessionConfiguration();
> sessionConfiguration.setConnector(connector);
> sessionConfiguration.setRepositoryName("repo1");
> CDOSession session = sessionConfiguration.openSession();
>
> CDORepositoryInfo repositoryInfo = session.getRepositoryInfo();
> System.out.println(repositoryInfo.isSupportingBranches());
>
>
> Best Regards and Thanks again!
> Philipp
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: [CDO] Enable Branching [message #666633 is a reply to message #666591] |
Thu, 21 April 2011 11:42 |
|
Am 21.04.2011 10:26, schrieb Philipp H.:
> Hello Eike,
>
> again many thanks for your answer.
You're welcome.
>
>> The last 3 are deprecated and ignored.
> Ok, then the http://wiki.eclipse.org/Getting_started_with_CDO_Helios should be updated.
Please feel free to fix the article. It's a community effort ;-)
>
>> <mappingStrategy type="horizontalBranching">
> When I use this mappingStrategy I get an exception during the start of the server:
>
> java.lang.IllegalStateException: BranchingSupport of MappingStrategy and Store do not match. Please check configuration.
That sounds weird.
> at org.eclipse.net4j.util.CheckUtil.checkState(CheckUtil.java:5 0)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.checkState(Lifecy cle.java:215)
> at org.eclipse.emf.cdo.server.internal.db.DBStore.doBeforeActiv ate(DBStore.java:429)
Please set a breakpoint here and see if you can find out what's wrong. If you send me a zip with *executable* projects I can also have a look for you.
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:69)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:98)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:88)
> at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:1305)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:72)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:98)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:88)
> at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:128)
> at org.eclipse.emf.cdo.internal.server.RepositoryConfigurator.c onfigure(RepositoryConfigurator.java:96)
> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplicat ion.doStart(CDOServerApplication.java:58)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplicat ion.java:61)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(An yThreadAppLauncher.java:26)
> at java.lang.Thread.run(Thread.java:619)
>
>
> My config looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cdoServer>
>
> <acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
> <!-- negotiator type="challenge" description="/temp/users.db"/ -->
> </acceptor>
>
> <repository name="repo1">
> <property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
> <property name="supportingAudits" value="true"/>
> <property name="supportingBranches" values="true"/>
>
> <store type="db">
> <mappingStrategy type="horizontalBranching">
> <property name="qualifiedNames" value="false"/>
> <property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE"/>
> <property name="toOneReferences" value="LIKE_ATTRIBUTES"/>
> </mappingStrategy>
>
> <dbAdapter name="h2"/>
> <dataSource class="org.h2.jdbcx.JdbcDataSource"
> uRL="jdbc:h2:_database/cdodb1"/>
> </store>
> </repository>
> </cdoServer>
>
> By the way the mapping strategy horizontalBranching is not mentioned in the CDO/Server Configuration Reference (http://wiki.eclipse.org/CDO_Server_Configuration_Reference)
I've perhaps already removed them because they're supposed to be superceeded by the delegating "horizontal" strategy.
> Futhermore I tryed CDO v4 out but unfortunately with exactly the same problem: no branching support (even with In-Memory) und the same exception when I use horizontalBranching.
Have a look into the DBStore's plugin.xml:
<extension
point="org.eclipse.emf.cdo.server.db.mappingStrategies">
<mappingStrategy
class=" org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho rizontalMappingStrategy "
type="horizontal"/>
<mappingStrategy
class=" org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho rizontalNonAuditMappingStrategy "
type="horizontalNonAuditing"/>
<mappingStrategy
class=" org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho rizontalAuditMappingStrategy "
type="horizontalAuditing"/>
<mappingStrategy
class=" org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho rizontalBranchingMappingStrategy "
type="horizontalBranching"/>
<mappingStrategy
class=" org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho rizontalAuditMappingStrategyWithRanges "
type="horizontalAuditingWithRanges"/>
<mappingStrategy
class=" org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.Ho rizontalBranchingMappingStrategyWithRanges "
type="horizontalBranchingWithRanges"/>
</extension>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Looking forward to help, since branching is an essential feature for our product.
>
> Best regards
> Philipp
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03538 seconds