Permalink
Browse files

Fixed issue #54 schema auto-creation failed to roll back on failed co…

…mmit.
  • Loading branch information...
tzaeschke committed Dec 18, 2018
1 parent 8041049 commit e05f99a8aa49e46e84a2896108dbe9a03c0ef594
@@ -4,6 +4,7 @@ CHANGELOG
===========
- T.Zaeschke
- Fixed Issue #109 and #110 : Inconsistency after removing attribute index..
- Fixed issue #54 : schema auto-creation fails to roll back properly when commit fails.

2018-Sep-17
===========
@@ -433,7 +433,11 @@ public void associateJavaTypes() {
}

public void associateJavaTypes(boolean failForMismatch) {
if (cls != null) {
associateJavaTypes(failForMismatch, false);
}

public void associateJavaTypes(boolean failForMismatch, boolean force) {
if (!force && cls != null) {
//TODO Why are checking this? String.equals is expensive...
if (!className.equals(ZooClassDef.class.getName()) &&
!className.equals(ZooPC.class.getName())) {
@@ -464,7 +464,7 @@ public void invalidate() {
isValid = false;
//in case the fields were create through a Java class (in stead of schema operations)
//we need to invalidate them from here
for (ZooFieldDef f: def.getAllFields()) {
for (ZooFieldDef f: def.getLocalFields()) {
f.getProxy().invalidate();
}
}
@@ -116,6 +116,7 @@ public void refreshSchemaAll() {
for (ZooClassDef def: cache.getSchemata()) {
def.jdoZooGetNode().refreshSchema(def);
def.getProvidedContext().getIndexer().refreshWithSchema(def);
def.associateJavaTypes(false, true);
}
}

0 comments on commit e05f99a

Please sign in to comment.