improved error reporting in XMI reader, fix of rollback in memoryimpl of storage
1.1 --- a/mdr/src/org/netbeans/mdr/persistence/memoryimpl/PrimaryIndexImpl.java Thu Oct 17 12:52:56 2002 +0000
1.2 +++ b/mdr/src/org/netbeans/mdr/persistence/memoryimpl/PrimaryIndexImpl.java Thu Oct 17 16:08:20 2002 +0000
1.3 @@ -23,14 +23,16 @@
1.4 /* Streams used to serialize data */
1.5 private ByteArrayOutputStream baoStrm = new ByteArrayOutputStream ();
1.6 private DataOutputStream daoStrm = new DataOutputStream (baoStrm);
1.7 + private StorageImpl storage;
1.8
1.9 /** Constructor used when restoring the streamable index from a stream. */
1.10 public PrimaryIndexImpl() {
1.11 }
1.12
1.13 /** Creates a new single-valued index. */
1.14 - public PrimaryIndexImpl(String name, Storage.EntryType keyType, Storage.EntryType valueType) {
1.15 - super (name, keyType, valueType);
1.16 + public PrimaryIndexImpl(StorageImpl storage, String name, Storage.EntryType keyType, Storage.EntryType valueType) {
1.17 + super (name, keyType, valueType);
1.18 + this.storage = storage;
1.19 }
1.20
1.21 /** Adds the specified value to values associated in this index with the
1.22 @@ -162,6 +164,9 @@
1.23 public Object resolveOriginalValue () throws StorageException {
1.24 ByteArrayInputStream baiStrm = new ByteArrayInputStream (bytes);
1.25 DataInputStream daiStrm = new DataInputStream (baiStrm);
1.26 + if (obj instanceof StorageClient) {
1.27 + ((StorageClient) obj).setStorage(storage);
1.28 + }
1.29 obj.read(daiStrm);
1.30 return obj;
1.31 }
2.1 --- a/mdr/src/org/netbeans/mdr/persistence/memoryimpl/StorageImpl.java Thu Oct 17 12:52:56 2002 +0000
2.2 +++ b/mdr/src/org/netbeans/mdr/persistence/memoryimpl/StorageImpl.java Thu Oct 17 16:08:20 2002 +0000
2.3 @@ -314,7 +314,7 @@
2.4 /** Creates primary index. Primary index is SinglevaluedIndex with STREAMABLE valueType.
2.5 */
2.6 private void createPrimaryIndex() throws StorageException {
2.7 - this.primaryIndex = new PrimaryIndexImpl(PRIMARY_INDEX_NAME, EntryType.MOFID, EntryType.STREAMABLE);
2.8 + this.primaryIndex = new PrimaryIndexImpl(this, PRIMARY_INDEX_NAME, EntryType.MOFID, EntryType.STREAMABLE);
2.9 addIndex(PRIMARY_INDEX_NAME, this.primaryIndex);
2.10 }
2.11