Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Clone example strange behavior(SQLException: Table definition has changed, please retry transaction)
[CDO] Clone example strange behavior [message #950482] Fri, 19 October 2012 23:33 Go to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
Hi all,
i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and changing master and clone repo name).

My master server is standalone, code at bottom.

I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
When in ReplicateRepositoryRawRequest it call:
context.replicateRaw(in, monitor);

within which it try to execute a simple select query:
SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created 

FROM Vendita cdo1, Vendita cdo2 

WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0


(Vendita is one of my model objects )
it lead to an SQLException:
java.sql.SQLException: Table definition has changed, please retry transaction


and can't figure out what does it mean.
What can it be ?

ps. i don't know it may help, but:
if i stop the sync process (while in debug mode) hence avoiding the rollback process, the next run of the clone will work smoothly without errors.

Clone:
//...
 protected IStore createStore()
  {
    MysqlDataSource dataSource = new MysqlDataSource();
    dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");

    IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
    IDBAdapter dbAdapter = new MYSQLAdapter();
    IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
    return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
  }
//...


Server:
public class Server {

	public static void main(String[] args) throws Exception
	  {		
	    OMPlatform.INSTANCE.setDebugging(true);
	    OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
	    OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);

	    Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
	    TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
	    CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server	    
	    
	    String name = "cdodb";
	    IStore store = createStore(name);
	    Map<String, String> properties = createProperties(name);

	    IRepository repository = CDOServerUtil.createRepository(name, store, properties);
	    CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);

	    Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");

	    while (System.in.available() == 0)
	    {
	      Thread.sleep(100);
	    }

	    System.out.println("deactivate");
	    LifecycleUtil.deactivate(repository);
	    LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
	  }

	  private static IStore createStore(String name)
	  {
		final boolean AUDITING = true;
		final boolean BRANCHING = true;
		  
		MysqlDataSource dataSource = new MysqlDataSource();
	    dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");

	    IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
	    IDBAdapter dbAdapter = new MYSQLAdapter();
	    IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
	    return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
	  }

	  private static Map<String, String> createProperties(String name)
	  {
	    Map<String, String> props = new HashMap<String, String>();
	    props.put(IRepository.Props.OVERRIDE_UUID, name);
	    props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
	    props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
	    return props;
	  }
}

[Updated on: Fri, 19 October 2012 23:53]

Report message to a moderator

Re: [CDO] Clone example strange behavior [message #951901 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951907 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951914 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951921 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951928 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951935 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951942 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951949 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951956 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951963 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951970 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951977 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951984 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951991 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #951998 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #952005 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #952012 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #952019 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #952026 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #952034 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #952042 is a reply to message #950482] Sun, 21 October 2012 03:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 20.10.2012 01:33, schrieb Michele Preti:
> Hi all,
> i'm trying the Clone example (org.eclipse.emf.cdo.examples.clone) with some basic modification (using mysql and
> changing master and clone repo name).
You should first try without modifications, especially Mysql can be problematic: http://bugs.mysql.com/bug.php?id=65378
If you insist on Mysql you may want to reopen that bug at Mysql.com.

> My master server is standalone, code at bottom.
>
> I still can't get the difference between replicare and replocateRaw, but the clone seem to use replicateRaw.
Raw replication is the newer and faster mode, especially for clones that have been offline for a longer period.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> When in ReplicateRepositoryRawRequest it call:
> context.replicateRaw(in, monitor);
> within which it try to execute a simple select query:
> SELECT cdo1.cdo_id, cdo1.cdo_branch, cdo1.cdo_version, cdo2.cdo_created
> FROM Vendita cdo1, Vendita cdo2
> WHERE cdo1.cdo_id=cdo2.cdo_id AND cdo1.cdo_branch=cdo2.cdo_branch AND (cdo1.cdo_version=cdo2.cdo_version-1 OR
> (cdo1.cdo_version+cdo2.cdo_version=-1 AND cdo1.cdo_version>cdo2.cdo_version)) AND cdo1.cdo_revised=0
>
> (Vendita is one of my model objects )
> it lead to an SQLException:
> java.sql.SQLException: Table definition has changed, please retry transaction
>
> and can't figure out what does it mean.
> What can it be ?
>
> Clone:
>
> //...
> protected IStore createStore()
> {
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/"+name+"?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(true, true);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
> //...
>
> Server:
> public class Server {
>
> public static void main(String[] args) throws Exception
> {
> OMPlatform.INSTANCE.setDebugging(true);
> OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
> OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
>
> Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
> TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
> CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
> String name = "cdodb";
> IStore store = createStore(name);
> Map<String, String> properties = createProperties(name);
>
> IRepository repository = CDOServerUtil.createRepository(name, store, properties);
> CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
>
> Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
>
> while (System.in.available() == 0)
> {
> Thread.sleep(100);
> }
>
> System.out.println("deactivate");
> LifecycleUtil.deactivate(repository);
> LifecycleUtil.deactivate(IPluginContainer.INSTANCE);
> }
>
> private static IStore createStore(String name)
> {
> final boolean AUDITING = true;
> final boolean BRANCHING = true;
> MysqlDataSource dataSource = new MysqlDataSource();
> dataSource.setURL("jdbc:mysql://localhost:3306/cdodb?user=user&password=user");
>
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(AUDITING, BRANCHING);
> IDBAdapter dbAdapter = new MYSQLAdapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> return CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> }
>
> private static Map<String, String> createProperties(String name)
> {
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, name);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "true");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "true");
> return props;
> }
> }


Re: [CDO] Clone example strange behavior [message #952496 is a reply to message #951901] Sun, 21 October 2012 14:16 Go to previous messageGo to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
thanks for your answers, but maybe you should delete some.

> If you insist on Mysql
I've tested with MySql just because i have it installed and i'm more familiar with. In the next days i'll may try with postgress.
But the backend is not really important, i just need it to be LGPL or Apache Licence. Maybe Derby ? Can you suggest an alternative?

> reopen that bug at Mysql.com.
If it's an already knowed bug, i doubt it can be solved just for me...
I've tryed to seek a workaround in the CDO code, but in the first i can't not even reproduce the bug...

[Updated on: Sun, 21 October 2012 14:40]

Report message to a moderator

Re: [CDO] Clone example strange behavior [message #952527 is a reply to message #952496] Sun, 21 October 2012 14:45 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 21.10.2012 16:16, schrieb Michele Preti:
> thanks for your answers, but maybe you should delete some.
>
>> If you insist on Mysql
> I've test with MySql just because i have it installed and i'm more familiar with. In the next days i'll may try with
> postgress.
PostgreSQL is similarly pathologic. For evaluating CDO I'd recommend H2. After the EclipseCon I can have a look at some
of the pending issues with tMysql and Postgresql.

> But the backend is not really important, i just need it to be LGPL or Apache Licence. Maybe Derby ? Can you suggest an
> alternative?
>
>> reopen that bug at Mysql.com.
> If it's an already knowed bug, i doubt it can be solved just for me...
They just closed it because the other CDO user did not respond anymore to questions.

> I've tryed to seek a workaround in the CDO code, but in the first i can't not even reproduce the bug...
Yeah, it's very hard with all the asynchronicity in multiple nodes ;-(

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Clone example strange behavior [message #952630 is a reply to message #952527] Sun, 21 October 2012 16:39 Go to previous messageGo to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
H2 work great, but:

I've created 13162 items from one element of my model.
It has 4 EStrings, 3 EFloat and 2 relations.

the H2 db file is 62MB, is it normal?

in the cdoresource_contents_list table there are 874490 rows, is that normal ?

i have other 30000 istances of other model elements to insert (just not wrote yet the import process)...

[Updated on: Sun, 21 October 2012 17:46]

Report message to a moderator

Re: [CDO] Clone example strange behavior [message #952710 is a reply to message #952630] Sun, 21 October 2012 18:16 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 21.10.2012 18:39, schrieb Michele Preti:
> H2 work great, but:
>
> I've created 13162 items from one element of my model.
> It has 4 EStrings, 3 EFloat and 2 relations.
>
> the H2 db file is 62MB, is it normal? i have other 30000 istances of other model elements to insert (just not wrote
> yet the import process)...
I've noticed that the H2 databases grow faster than I expected. But I'm really no DB operator and can absolutely not
judge whether that's normal. Maybe you want to ask on an H2 forum and report here...

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Clone example strange behavior [message #952756 is a reply to message #952710] Sun, 21 October 2012 19:10 Go to previous messageGo to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
you'r right, but i notice that the table cdoresource_contents_list has 874225 rows, is that normal ?
Re: [CDO] Clone example strange behavior [message #952829 is a reply to message #952756] Sun, 21 October 2012 20:32 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 21.10.2012 21:10, schrieb Michele Preti:
> you'r right, but i notice that the table cdoresource_contents_list has 874225 rows, is that normal ?
Probably. That table contains one row per EObject that *directly* contained by a Resource. Do yo have so many resources
or so many root objects per Resource?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] Clone example strange behavior [message #952947 is a reply to message #952829] Sun, 21 October 2012 22:54 Go to previous messageGo to next message
Michele Preti is currently offline Michele PretiFriend
Messages: 14
Registered: October 2012
Junior Member
No, i only have 13170 EObject, but I've got where is the problem:

my import code was something like this:
CDOSession session = openSession();		
		CDOTransaction transaction = session.openTransaction();
		CDOResource resource = transaction.getOrCreateResource("res1");
		
		EList<EObject> content = resource.getContents();
		
		for(int i = 0; i < 100; i++){
			Cliente c = InventarioFactory.eINSTANCE.createCliente(); //one of my model objects
			c.setPIva(i+"");
			c.setIndirizzo1("ind"+i);
			
			content.add(c);
			try {
				transaction.commit();
			} catch (CommitException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}	


After each content.add() it commit the transaction (in this example is after each, in the import was after 100).
This way CDO insert the new item, but also create a new row (incrementing the version) for each already added item (but only in the cdoresource_contents_list table).

Is this behaviour normal? And if it is:

My application is interactive, where a user may create a new item, click save, and the item must be persisted (transaction committed) then he may create a new one. I can't create a new version for each unmodified and already stored item. How can i persist the user object avoiding this behaviour ?

I know it's wierd, commiting multiple time the same transaction, probably it's not intended, but it's the same opening a new transaction for each item:

CDOSession session = openSession();		
		CDOTransaction transaction;
		CDOResource resource;		
		
		for(int i = 0; i < 100; i++){
			transaction = session.openTransaction();
			resource = transaction.getOrCreateResource("res1");
			
			EList<EObject> content = resource.getContents();
			
			Cliente c = InventarioFactory.eINSTANCE.createCliente();
			c.setPIva(i+"");
			c.setIndirizzo1("ind"+i);
			
			content.add(c);
			try {
				transaction.commit();
				transaction.close();
			} catch (CommitException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}	

And in this case i reload the *resource* each time, is it not a waste of time and resources?

Here a sql dump of the H2 db : mediafire.com/?0000270jb1qaq7b
Re: [CDO] Clone example strange behavior [message #953303 is a reply to message #952947] Mon, 22 October 2012 06:08 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 22.10.2012 00:54, schrieb Michele Preti:
> No, i only have 13170 EObject, but I've got where is the problem:
>
> my import code was something like this:
> CDOSession session = openSession();
> CDOTransaction transaction = session.openTransaction();
> CDOResource resource = transaction.getOrCreateResource("res1");
>
> EList<EObject> content = resource.getContents();
>
> for(int i = 0; i < 100; i++){
> Cliente c = InventarioFactory.eINSTANCE.createCliente(); //one of my model objects
> c.setPIva(i+"");
> c.setIndirizzo1("ind"+i);
>
> content.add(c);
> try {
> transaction.commit();
> } catch (CommitException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>
> After each content.add() it commit the transaction (in this example is after each, in the import was after 100).
> This way CDO insert the new item, but also create a new row (incrementing the version) for each already added item
> (but only in the cdoresource_contents_list table).
>
> Is this behaviour normal?
It depends. Offline repository replication requires branching mode, which implies auditing as well. So yes,it's normal
that all "intermediary" but committed states of the model are preserved. With the DBStore you can compact redundant list
element copies with the range-based mapping strategies. Formerly those didn't work correctly with repository
replication, but I think we've fixed that at some point. Can you just try?

> And if it is:
> My application is interactive, where a user may create a new item, click save, and the item must be persisted
> (transaction committed) then he may create a new one. I can't create a new version for each unmodified and already
> stored item.
That does not happen anyway! You only get new CDORevisions of *modified* (or new) objects, i.e. the CDOResource you're
adding to. Existing objects *in* that resource are not copied unless they're actually modified.

> How can i persist the user object avoiding this behaviour ?
As I said, with offline replication (or auditing mode in general) you can't avoid it. Depending on the used Store type
you can optimize it more or less.

> I know it's wierd, commiting multiple time the same transaction,
No, that's exactly how it's supopsed to be used! Think of a view/transaction as an SQL Connection. You don't close that
after each commit either, do you?

> probably it's not intended, but it's the same opening a new transaction for each item:
Yes, just that it's way slower.

>
>
> CDOSession session = openSession();
> CDOTransaction transaction;
> CDOResource resource;
>
> for(int i = 0; i < 100; i++){
> transaction = session.openTransaction();
> resource = transaction.getOrCreateResource("res1");
>
> EList<EObject> content = resource.getContents();
>
> Cliente c = InventarioFactory.eINSTANCE.createCliente();
> c.setPIva(i+"");
> c.setIndirizzo1("ind"+i);
>
> content.add(c);
> try {
> transaction.commit();
> transaction.close();
Things that need closing should be closed in finally blocks.

> } catch (CommitException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
You can only ignore CommitExceptions if you're going to close the transaction anyway, which you're not. Call
transaction.rollback() here.


> }
> }
>
> And in this case i reload the *resource* each time, is it not a waste of time and resources?
Yes!

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[CDO] How to construct connection aware URIs
Next Topic:Undo operations with EString attributes
Goto Forum:
  


Current Time: Thu Mar 28 11:20:10 GMT 2024

Powered by FUDForum. Page generated in 0.05353 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top