1 Reply Latest reply on Apr 17, 2013 1:36 PM by JinZhao-Oracle

    BDB0088 DB_SECONDARY_BAD: Secondary index inconsistent with primary

      I am a bit new to Berkeley DB so please be indulgent.
      I am using Berkeley DB 5.3.21. I am using the Java interface.
      I have a entity class EntityClass.
      public class EntityClass {
      // Primary key is pKey
      private DeweyString dewey;

      // Secondary key is the sKey
      private String nodeName;

      class DeweyString implements Comparable<DeweyString> {

      String value;

      DeweyString(String value) { this.value = value; }

      private DeweyString() {}

      public int compareTo(DeweyString o) {
      The DeweyString class implements the Comparable interface. Now I get the secondaryKey, and use the secondaryKey.subIndex(tagname).entities() then I iterator the EntityCursor, but bdb throws exception. the errior is "EntityStore-bdb.EntityClass: BDB0088 DB_SECONDARY_BAD: Secondary index inconsistent with primary".

      Thanks for your advices.