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. --- RELEASE-NOTES.txt | 1 + pom.xml | 2 +- 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 +- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 7d99716..3ef6f98 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -4,6 +4,7 @@ Carbonado change history 1.1-BETA5 to 1.1-BETA6 ------------------------------- - Added automatic repair for broken layout metadata. +- Add Storable to CorruptEncodingException when loading from index. - Fix conversion of null lobs. - Query filter constants appear as SQL constants. diff --git a/pom.xml b/pom.xml index a1ec166..90b57ba 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ carbonado jar Carbonado - 1.1-BETA5 + 1.1-BETA6 Extensible, high performance persistence abstraction layer for Java applications with a relational view to the underlying persistence technology. 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