diff options
author | Eike Stepper | 2016-02-04 17:33:21 +0000 |
---|---|---|
committer | Eike Stepper | 2016-02-04 17:33:21 +0000 |
commit | f11f14a3b2711978ad96d835dd69b2384721bb37 (patch) | |
tree | 7e7417c196fad4ab082c69340a4b0290a05a8538 | |
parent | 08257c866d21ff0592802c754820f9996d45802e (diff) | |
download | cdo-f11f14a3b2711978ad96d835dd69b2384721bb37.tar.gz cdo-f11f14a3b2711978ad96d835dd69b2384721bb37.tar.xz cdo-f11f14a3b2711978ad96d835dd69b2384721bb37.zip |
[482886] MySQL InnoDB needs commit after package creation
https://bugs.eclipse.org/bugs/show_bug.cgi?id=482886
-rw-r--r-- | plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java index 31581f12f7..6af3fc969b 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java @@ -516,8 +516,14 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I public void writeRevision(IDBStoreAccessor accessor, InternalCDORevision revision, boolean mapType, boolean revise, OMMonitor monitor) { + // If the repository's root resource ID is not yet set, then this must be the initial initRootResource() + // commit. The duplicate check is certainly not needed in this case, and it appears that Mysql has problems + // with it (Table definition has changed, please retry transaction), see bug 482886. + boolean duplicateResourcesCheckNeeded = revision.isResourceNode() + && mappingStrategy.getStore().getRepository().getRootResourceID() != null; + + monitor.begin(duplicateResourcesCheckNeeded ? 10 : 9); Async async = null; - monitor.begin(10); try { @@ -548,19 +554,19 @@ public abstract class AbstractHorizontalClassMapping implements IClassMapping, I } } - try + if (duplicateResourcesCheckNeeded) { - async = monitor.forkAsync(); - if (revision.isResourceNode()) + try { + async = monitor.forkAsync(); checkDuplicateResources(accessor, revision); } - } - finally - { - if (async != null) + finally { - async.stop(); + if (async != null) + { + async.stop(); + } } } |