svn commit: r16953 - trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiWriterMDRImpl.java
Tom Morris <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: tfmorris
Date: 2009-03-26 11:09:31-0700
New Revision: 16953
Modified:
trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiWriterMDRImpl.java
Log:
Write XMI file in a single MDR transaction for consistency and performance.
Modified: trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiWriterMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiWriterMDRImpl.java?view=diff&pathrev=16953&r1=16952&r2=16953
==============================================================================
--- trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiWriterMDRImpl.java (original)
+++ trunk/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiWriterMDRImpl.java 2009-03-26 11:09:31-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 2005-2008 The Regents of the University of California. All
+// Copyright (c) 2005-2009 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
@@ -127,9 +127,15 @@
XMIWriter xmiWriter = XMIWriterFactory.getDefault().createXMIWriter(
config);
try {
- RefPackage extent = ((RefObject) model).refOutermostPackage();
- xmiWriter.write(oStream, "file:///ThisIsADummyName.xmi", extent,
- XMI_VERSION);
+ modelImpl.getRepository().beginTrans(false);
+ try {
+ RefPackage extent = ((RefObject) model).refOutermostPackage();
+ xmiWriter.write(oStream, "file:///ThisIsADummyName.xmi", extent,
+ XMI_VERSION);
+ } finally {
+ // end our transaction
+ modelImpl.getRepository().endTrans();
+ }
} catch (IOException e) {
throw new UmlException(e);
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1433212
To unsubscribe from this discussion, e-mail: [[email protected]].