Sergey Stupnikov
2006-11-30 11:55:01 UTC
Hi all,
I use mdr as a storage for uml models in my tool, and load models from
XMI files by the following code (similar to the code of UML2MOF):
rep = MDRManager.getDefault().getDefaultRepository();
uri = new File(afileName).toURL().toString();
info(uri);
reader = (XmiReader) Lookup.getDefault().lookup(XmiReader.class);
initUmlPackage();
rep.beginTrans(true);
try {
reader.read(uri, uml);
...
} finally {
rep.endTrans(true);
MDRManager.getDefault().shutdownAll();
}
The problem is the code works properly only once without terminating
JVM. When I try to use these code again I obtain the subject exception
thrown by XMIReader read() method.
I looked for the same situations in the mailing list and found
the thread "Model files being locked".
Could you please clarify for me if I my problem is connected with
locking the files by mdr or not?
And if so how can I solve my problem?
Because I do not clearly realize how to
"turn off default JAR caches (URLConnection method)" or
"to use reflection to manually clear the caches (a hack), or to supply
your own URL handler for such URLs"
in my situation.
Thank you a lot for the help.
I use mdr as a storage for uml models in my tool, and load models from
XMI files by the following code (similar to the code of UML2MOF):
rep = MDRManager.getDefault().getDefaultRepository();
uri = new File(afileName).toURL().toString();
info(uri);
reader = (XmiReader) Lookup.getDefault().lookup(XmiReader.class);
initUmlPackage();
rep.beginTrans(true);
try {
reader.read(uri, uml);
...
} finally {
rep.endTrans(true);
MDRManager.getDefault().shutdownAll();
}
The problem is the code works properly only once without terminating
JVM. When I try to use these code again I obtain the subject exception
thrown by XMIReader read() method.
I looked for the same situations in the mailing list and found
the thread "Model files being locked".
Could you please clarify for me if I my problem is connected with
locking the files by mdr or not?
And if so how can I solve my problem?
Because I do not clearly realize how to
"turn off default JAR caches (URLConnection method)" or
"to use reflection to manually clear the caches (a hack), or to supply
your own URL handler for such URLs"
in my situation.
Thank you a lot for the help.
--
Best regards,
Sergey Stupnikov mailto:***@ipi.ac.ru
Best regards,
Sergey Stupnikov mailto:***@ipi.ac.ru