Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/AbstractHorizontalClassMapping.java24
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();
+ }
}
}

Back to the top