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 19:33  |
Eclipse User |
|
|
|
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 19:53] by Moderator
|
|
|
Re: [CDO] Clone example strange behavior [message #951901 is a reply to message #950482] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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] |
Sat, 20 October 2012 23:56   |
Eclipse User |
|
|
|
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 #952947 is a reply to message #952829] |
Sun, 21 October 2012 18:54   |
Eclipse User |
|
|
|
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 02:08  |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Tue Jul 22 18:06:15 EDT 2025
Powered by FUDForum. Page generated in 0.09582 seconds
|