Community
Participate
Working Groups
I have disabled audits and branches. In some cases, when deleting an object the revision number is set to a negative number instead of deleting it permanently. In other cases it is just deleted as expected. I will try to create a scenario to reproduce this...
I can confirm this behaviour but in my case it seems to always happen. In the configuration I set <property name="supportingAudits" value="false"/> Using CDO 4.0 (Indigo Release)
For me, it works when the object is not contained directly in the CDOResource.
I can also confirm that the nonaudit class mapping does not delete the row from the attribute table. (see detachAttributes() in HorizontalNonAuditClassMapping). All many references are removed correctly. In addition this object is also not deleted from the CDO_OBJECTS table.
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Hi Eike, I am willing to sponsor this fix. rgds Christophe
Sounds great ;-) Will we meet at the EclipseCon to discuss this?
Turning back into a problem so that the fix can be applied to maintenance, too.
This fix comes with a new feature: an automatic schema migration mechanism. It detects code updates and migrates (the database of) an existing instance automatically. Please note that we consider all schema changes like API changes and, even if compatible, we can't silently apply them to maintenance. This also makes the schema versioning itself magnitudes simpler (a linear version chain is enough, instead of a two dimensional matrix of migration rules). That means you'll either have to upgrade to a new I-build (CDO 4.2) or apply the changes to an older repository yourself. commit d3fd5cce836a3542504238bf953d53c554b0c52d
*** Bug 359021 has been marked as a duplicate of this bug. ***
*** Bug 312670 has been marked as a duplicate of this bug. ***
Using the latest integration build: emf-cdo-I20121110-0001-Dropins throws a MySQL Syntax expression. !ENTRY org.eclipse.emf.cdo.server 1 0 2012-11-12 11:36:34.686 !MESSAGE CDO server starting [INFO] Migrating schema from version 1 to version 2... !ENTRY org.eclipse.emf.cdo.server.db 1 0 2012-11-12 11:36:35.078 !MESSAGE Migrating schema from version 1 to version 2... [INFO] Migrating schema from version 2 to version 3... !ENTRY org.eclipse.emf.cdo.server.db 1 0 2012-11-12 11:47:28.532 !MESSAGE Migrating schema from version 2 to version 3... [ERROR] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 org.eclipse.net4j.util.lifecycle.LifecycleException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:104) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104) at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1885) at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76) at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalActivate(ShareableLifecycle.java:43) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104) at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:208) at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:113) at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61) at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26) at java.lang.Thread.run(Thread.java:722) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 at sun.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:842) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:681) at org.eclipse.emf.cdo.server.internal.db.DBStore$3.migrateSchema(DBStore.java:929) at org.eclipse.emf.cdo.server.internal.db.DBStore.migrateSchema(DBStore.java:858) at org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate(DBStore.java:594) at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76) ... 16 more !ENTRY org.eclipse.net4j.util 4 0 2012-11-12 11:47:28.539 !MESSAGE com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 !STACK 0 org.eclipse.net4j.util.lifecycle.LifecycleException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:104) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104) at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1885) at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76) at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalActivate(ShareableLifecycle.java:43) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104) at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:208) at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:113) at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61) at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26) at java.lang.Thread.run(Thread.java:722) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 at sun.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:842) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:681) at org.eclipse.emf.cdo.server.internal.db.DBStore$3.migrateSchema(DBStore.java:929) at org.eclipse.emf.cdo.server.internal.db.DBStore.migrateSchema(DBStore.java:858) at org.eclipse.emf.cdo.server.internal.db.DBStore.doActivate(DBStore.java:594) at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76) ... 16 more !ENTRY org.eclipse.equinox.app 4 0 2012-11-12 11:47:28.542 !MESSAGE com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 !STACK 0 org.eclipse.net4j.util.lifecycle.LifecycleException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:104) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104) at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1885) at org.eclipse.net4j.util.lifecycle.Lifecycle.internalActivate(Lifecycle.java:76) at org.eclipse.net4j.util.lifecycle.ShareableLifecycle.internalActivate(ShareableLifecycle.java:43) at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:162) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:114) at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:104) at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:208) at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:113) at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61) at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26) at java.lang.Thread.run(Thread.java:722) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TO lsize BIGINT' at line 1 at sun.reflect.GeneratedConstructorAccessor12.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java
there is no 'TO' keyword in the doc. [13-11-12 15:49:01] Christophe Bouhier: CHANGE [COLUMN] old_col_name new_col_name column_definition [FIRST|AFTER col_name] [13-11-12 15:53:07] Christophe Bouhier: migration 1 -> 2 is OK which is the one I care about. [13-11-12 15:54:26] Christophe Bouhier: migration 2-> 3 is the lob rename thingy which "used" to fail [13-11-12 15:54:34] Christophe Bouhier: ALTER TABLE cdo_lobs CHANGE COLUMN size lsize BIGINT [13-11-12 15:58:33] Christophe Bouhier: oops new error: [13-11-12 15:58:34] Christophe Bouhier: [ERROR] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.cdo_id) FROM cdo_objects "o", cdo_branches "t" WHERE "t".cdo_branch<0 AND "t".c' at line 1 org.eclipse.net4j.db.DBException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.cdo_id) FROM cdo_objects "o", cdo_branches "t" WHERE "t".cdo_branch<0 AND "t".c' at line 1 at org.eclipse.emf.cdo.server.internal.db.DBStore.visitAllTables(DBStore.java:277) [13-11-12 15:58:46] Christophe Bouhier: this is the query which visits the tables.
After schema migration the following fails: private CDOID getMinLocalID(Connection connection) the syntax is not correct: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.cdo_id) FROM cdo_objects "o", cdo_branches "t" WHERE "t".cdo_branch<0 AND "t".c' at line 1 1) You can't use the quoted alias "t" in the min function. 2) In my case there is no cdo_branch column in the tables, so this will fail as well. I execute the following without quoted alias, which works fine: SELECT MIN(t.cdo_id) FROM TM.cdo_objects o, TM.generics_value t WHERE t.cdo_id=o.cdo_id AND t.cdo_created = o.cdo_created;
Created attachment 223519 [details] sqlRenameField The TO keyword is not valid. See: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
Created attachment 223531 [details] getMinLocalID SQL Query alias not allowed in MIN MySQL function.
Reopening to address the Mysql issues Christophe found/fixed...
(In reply to comment #15) > The TO keyword is not valid. commit 1b73d8be682c402c31ab52fe56305b43ac44bdc6
(In reply to comment #16) > Created attachment 223531 [details] > getMinLocalID > > SQL Query alias not allowed in MIN MySQL function. This confuses me. You don't seem to remove the alias as such. Is this really just a problem of the double quotes that I added for Oracle?
I've removed ALL double quotes around alias names via bug 393111.
Strange that noone ever complained about getMinLocalID() not working in non-branching mode! Everybody must be using branching mode or be eager to always shutdown properly :P The concept of "local IDs" is meaningless in non-branching mode. So I guarded the call to getMinLocalID() as follows: if (repository.isSupportingBranches()) { CDOID minLocalID = getMinLocalID(connection); idHandler.setNextLocalObjectID(minLocalID); } commit c734ed318fff4aa6530e84530bb528010eae562f
*** Bug 394207 has been marked as a duplicate of this bug. ***
My explanation was not correct, what MySQL complains about is the quoted alias in the MIN function, so removing them as in the attached patch did the trick.
perhaps it's a different bug, but a proper shutdown on my side. (typing shutdown in the osgi console) , still goes into crash recovery mode the next time I start the server. Perhaps I need to clean-up some CDO stuff in a osgi stop() bundle?
(In reply to comment #24) > perhaps it's a different bug, but a proper shutdown on my side. (typing > shutdown in the osgi console) Hmm, I always use "close". Can you please try that instead?
with 'close' CDO starts normally, the next run, without going into crash detect
Excellent ;-)
I have just tried this out with CDO 4.2 from http://download.eclipse.org/modeling/emf/cdo/drops/S20121114-1534 I"m currently running EMF 2.8.1 and I keep getting an IllegalAccessError (Stacktrace below). I guess this means I will need an I build of EMF 2.9? Is there any chance this fix makes it into 4.1 maintainance? Exception in thread "CDOInvalidationRunner-View 1" java.lang.IllegalAccessError: tried to access method org.eclipse.emf.ecore.impl.ENotificationImpl.<init>(Lorg/eclipse/emf/ecore/InternalEObject;ILorg/eclipse/emf/ecore/EStructuralFeature;II)V from class org.eclipse.emf.internal.cdo.object.CDODeltaNotificationImpl at org.eclipse.emf.internal.cdo.object.CDODeltaNotificationImpl.<init>(CDODeltaNotificationImpl.java:83) at org.eclipse.emf.internal.cdo.object.CDONotificationBuilder.createNotification(CDONotificationBuilder.java:292) at org.eclipse.emf.internal.cdo.object.CDONotificationBuilder.visit(CDONotificationBuilder.java:164) at org.eclipse.emf.cdo.internal.common.revision.delta.CDOSetFeatureDeltaImpl.accept(CDOSetFeatureDeltaImpl.java:69) at org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl.accept(CDORevisionDeltaImpl.java:309) at org.eclipse.emf.internal.cdo.object.CDONotificationBuilder.buildNotification(CDONotificationBuilder.java:88) at org.eclipse.emf.internal.cdo.view.CDOViewImpl.sendDeltaNotifications(CDOViewImpl.java:977) at org.eclipse.emf.internal.cdo.view.CDOViewImpl.doInvalidate(CDOViewImpl.java:857) at org.eclipse.emf.internal.cdo.view.CDOViewImpl$InvalidationRunnable.run(CDOViewImpl.java:1591) at org.eclipse.net4j.util.concurrent.QueueRunner.work(QueueRunner.java:26) at org.eclipse.net4j.util.concurrent.QueueRunner.work(QueueRunner.java:1) at org.eclipse.net4j.util.concurrent.QueueWorker.doWork(QueueWorker.java:88) at org.eclipse.net4j.util.concurrent.QueueWorker.work(QueueWorker.java:79) at org.eclipse.net4j.util.concurrent.Worker$WorkerThread.run(Worker.java:206)
Oh, I was not aware that I accidentally started to use EMF 2.9 specific API. I'll investigate alternatives...
Oops, the problem was introduced by bug 376620. Please cc your self to that one to follow...
Available in R20130613-1157 (4.2)