From 80fdb36c2780744f12d3fc527812ecf62980ad8b Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 1 Dec 2006 05:02:37 +0000 Subject: Add Storable to CorruptEncodingException when loading from index. --- src/main/java/com/amazon/carbonado/layout/Layout.java | 2 +- .../com/amazon/carbonado/layout/LayoutProperty.java | 6 ++++-- .../com/amazon/carbonado/raw/GenericStorableCodec.java | 18 +++++++++++++++++- .../carbonado/repo/sleepycat/BDBRepositoryBuilder.java | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/amazon/carbonado/layout/Layout.java b/src/main/java/com/amazon/carbonado/layout/Layout.java index d127835..62e29f2 100644 --- a/src/main/java/com/amazon/carbonado/layout/Layout.java +++ b/src/main/java/com/amazon/carbonado/layout/Layout.java @@ -420,7 +420,7 @@ public class Layout { mStoredLayout.update(); } for (LayoutProperty property : mAllProperties) { - property.insert(); + property.store(); } } } diff --git a/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java b/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java index 4a7dea1..a0ce48f 100644 --- a/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java +++ b/src/main/java/com/amazon/carbonado/layout/LayoutProperty.java @@ -185,7 +185,9 @@ public class LayoutProperty { return mStoredLayoutProperty.toString(); } - void insert() throws PersistException { - mStoredLayoutProperty.insert(); + void store() throws PersistException { + if (!mStoredLayoutProperty.tryInsert()) { + mStoredLayoutProperty.update(); + } } } diff --git a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java index cac1283..8113b32 100644 --- a/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java +++ b/src/main/java/com/amazon/carbonado/raw/GenericStorableCodec.java @@ -124,6 +124,7 @@ public class GenericStorableCodec implements StorableCodec implements StorableCodec