Skip to main content
Jump to: navigation, search

Difference between revisions of "CDO QuickStart"

Line 1: Line 1:
On this page how to quickly setup and run a CDO server
On this page how to quickly setup and run a CDO server
== Workspace Setup ==
== Workspace Setup ==

Revision as of 06:24, 20 January 2009

On this page how to quickly setup and run a CDO server

Workspace Setup

  • create a new project named "cdo.serverConfig"
  • create a new folder named "configuration"
  • create a new xml-file cdo-server.xml in new folder and put the following content into the file
<?xml version="1.0" encoding="UTF-8"?>
	<!--acceptor type="http"/ -->
	<acceptor type="tcp" listenAddr="" port="2036">
		<!-- negotiator type="challenge" description="/temp/users.db"/ -->
	<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"/>
		<store type="db">
			<mappingStrategy type="horizontal">
				<property name="qualifiedNames" value="false"/>
				<property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE"/>
				<property name="toOneReferences" value="LIKE_ATTRIBUTES"/>
			<!-- Old setting <jdbcDelegate type="statement" />
			     is now replaced by preparedStatement: --> 
			<jdbcDelegate type="preparedStatement" > 			
			    <!-- to explicitly force prepared statement caching (e.g., if statement pooling is not supported 
			         by the JDBC driver, use
			   <property name="cacheStatements" value="enabled" /> 
			         Else, the implicit default is:
			   <property name="cacheStatements" value="guess" />
			         Which guesses the correct setting based on the JDBC driver's metadata.
			         Also supported is the third setting "disabled".
			<dbAdapter name="derby-embedded"/>
			<dataSource class="org.apache.derby.jdbc.EmbeddedDataSource"
			<dbAdapter name="hsqldb"/>
			<dataSource class="org.eclipse.net4j.db.hsqldb.HSQLDBDataSource" 
			<dbAdapter name="mysql"/>
			<dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" 
			<dbAdapter name="postgresql"/>
			<dataSource class="org.postgresql.ds.PGSimpleDataSource"

Create launch config

  • Create a new Eclipse Application launch configuration
  • On the main tab in the 'Program to Run' section set teh radio button to 'Run an application' and select ''
  • Switch to the Arguments tab and
    • set
      -os ${target.os} -ws ${} -arch ${target.arch} -nl ${} -debug -console
      as program argument
    • set
      -Xms40m -Xmx1024m -Ddebug=true -Dnet4j.config=${resource_loc:/cdo.serverConfig/configuration} -Dorg.osgi.service.http.port=8080
      as VM arguments

Starting the server

Now go and fire up the newly created launch configuration

On the console you should get something similar to

Configuration location:
Configuration file:
    file:/C:/eclipse/3.5M4/eclipse/ws/.metadata/.plugins/org.eclipse.pde.core/cdo-server/config.ini loaded
Install location:
Framework located:
Framework classpath:
Splash location:
Debug options:
    file:/C:/eclipse/3.5M4/eclipse/.options not found
osgi> Time to load bundles: 0
Starting application: 1888
[INFO] CDO Server starting
[INFO] CDO Server started
Application Started: 10363

Testing the server configuration

  • Open the 'CDO Sessions' view
  • Create a new session using the '+' icon from the views toolbar
    • use
      as server description
    • repo1
      has to be used as repository name
    • Hit finish
  • Using the context menu on the session, you can register new ecore packages
  • Select the session and open a new transaction from the context menu
  • Open the context menu on the transaction an hit 'Create Resource...', choose a name and hit finish
  • The resource editor opens and you can create new model elements in it using the context menu

Back to the top