"Secondary is corrupt: the primary record ..."

We're using 3.3.98. When attempting to delete all records from an EntityStore, we're getting the error "com.sleepycat.je.SecondaryIntegrityException: (JE 4.1.6) Secondary is corrupt: the primary record contains a key that is not present in the secondary".
There's no additional detail about which key it is that isn't in the secondary, so not sure the source of the issue. The error happens on each of the last three records in the database. Each one has some null values in a MANY_TO_ONE secondary indexed field.
We've tried deleting from secondary key index first, but still get the exception. The exceptions in each case occur when deleting from the primary index.
Could having null values in a secondary index somehow be causing problems (even if the relationship type is MANY_TO_ONE)?
-tyson

It looks like you're using 4.1, thought you said 3.3 earlier. Although it's not printed as part of the exception message, you can call SecondaryIntegrityException.getPrimaryKey and getSecondaryKey and print them yourself when you catch the exception. To translate the DatabaseEntry to DPL syntax, use PrimaryIndex or SecondaryIndex.getKeyBinding.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Select statement from a join file deletes the primary records with MS Expl.

    Hello,
    is reality,
    Select statement from a join file deletes the primary records with MS Explorer 6, Firefox not, this with a normal data provider or with a normal "select..." statement.
    This is very strange, I should have a.a.s.p. a solution or workaround
    Thanks, Franco.
    Message was edited by:
    fbiaggi

    Please see the following excerpt from the online documentation.
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_modes.htm#SUTIL1332
    Enabled Constraints
    During a direct path load, the constraints that remain enabled are as follows:
    NOT NULL
    UNIQUE
    PRIMARY KEY (unique-constraints on not-null columns)
    NOT NULL constraints are checked at column array build time. Any row that violates the NOT NULL constraint is rejected.
    Even though UNIQUE constraints remain enabled during direct path loads, any rows that violate those constraints are loaded anyway (this is different than in conventional path in which such rows would be rejected). When indexes are rebuilt at the end of the direct path load, UNIQUE constraints are verified and if a violation is detected, then the index will be left in an Index Unusable state. See "Indexes Left in an Unusable State".

  • GB chooses to open on secondary monitor, not the primary monitor?  It was working fine, then started this.

    New Mac Mini running new Garageband.  2 monitors.  Working fine, however, all of a sudden GB started to choose to open and not be able to move from secondary monitor.  What may have changed and how can I rectify this.  I would like GB to open on the primary.  All of applications open on primary monitor.

    There is some confusing information in your post.  You say iMac g5 & 10.6.6.  The iMac g5 cannot run 10.6.6.  10.6.6 requires an intel machine.
    I'll assume iMac g5.
    There have been many reports of capacitor problems with these machines.  There are capacitor replacement kits if you want to experiment with a soldering iron.
    You could try a new battery.
    Since you are having succes running the machine, I'd say it is a hardware problem. I've read a little on the capacitor problem.  Seems to fit what I have heard.
    google: g5 capacitor replacement kit
    Seems rather inexpensive.
    http://thecapking.com/applg5.html
    & lots of info on repairing on this site.  Offers this good suggestion.
    "Additionally you may also go to any Apple Retail Store with a Genus Bar, and have the Apple folks take a look inside the G5 and look at the caps on the iMac logic board for you."
    http://jimwarholic.com/2008/07/how-to-repair-apple-imac-g5.php

  • How can i reassign images from a secondary folder to the primary folder?

    I have two LR library folders, 2014 high-level folder and another 2014 folder as a sub-folder to the high-level 2014 folder. (Yes, I screwed up.) How do I end up with all images in the high-level folder only and delete the sub-level folder?

    OK, I think I have found the problem...and it is I. There is a check box in LR/Import option under Destination in the right panel. The "Into Subfolder" check box was checked indicating that LR should create a subfolder (child) under whatever folder was indicated for the imported images to go to when importing. I unchecked this box and everything is OK. I must have unwittingly hit a key activating the subfolder creation option and didn't notice it.
    Thanks for helping out. I really appreciate when someone takes the time and trouble to help others.

  • I have 2 iCloud accounts. Can I delete one account so I can make use of additional space I purchased for the secondary account? Also iPhoto seems to only connect to the primary account? How do I send files to the secondary account?

    I have 2 iCloud accounts. Can I delete one account so I can make use of additional space I purchased for the secondary account? Also iPhoto seems to only connect to the primary account? How do I send files to the secondary account?

    Both accounts are completely independent from each other. In order to use the space that you have purchased for your secondary account, you must change it to become your primary account. Yes, as you said, services like photo stream only work with the primary account. Unfortunately, there is no comfortable way to just transfer data from one account to another one, but you can do it via a third party application e.g. via Dropbox: e.g. for photos: photos stored with your current primary account > manual transfer to dropbox > after you made your secondary account to the primary account,  transfer the photos back to your new primary account etc.

  • Does a secondary SATA drive failure affect the primary drive?

    I have two internal drives, and the secondary drive failed. The system would not boot until I removed the secondary drive. Why would the secondary drive failure affect the primary drive?

    A severely corrupt directory on any drive can prevent booting from hard drives and even DVD and CDs that otherwise should boot because the system still 'looks' to see if and where other system drives are located.
    That can require pulling the drive in order to boot, put it in a Firewire or USB case, and only after the system is up - and maybe Disk Warrior or TechTool Pro launched - connect the drive.
    Just one more reason to keep backups of your drives, and multiple boot drives (working backup, test system, emergency only, are good to have).
    Why it is failing is another matter, need for a good solid UPS (I was doing an install that takes 45 minutes when we had an outage, probably due to severe weather and strain on the grid). Luckily I have extra runtime.

  • Insert record and return the primary key

    Okay, I need to insert a record into a MSSQL database and return the primary key of that record. Im using the following code which is obviously wrong as I'm getting either 'NULL' or 'com.microsoft.jdbc.base.BaseResultSet@1d520c4' returned depending on the ways I've tried. The primary key is an int value called clientID which is incremented by one each time a new record is added.
    // set the prepared statement
                String sql="INSERT INTO Client(username, country, clientIP, browser, os) VALUES(?,?,?,?,?)";
                PreparedStatement pstmt = conn.prepareStatement(sql);
                pstmt.setString(1, inUserName);
                pstmt.setString(2, inCountry);
                pstmt.setString(3, inClientIP);
                pstmt.setString(4, inBrowser);
                pstmt.setString(5, inOS);
                // Insert the row
                pstmt.executeUpdate();
                Statement stmt = conn.createStatement();
                ResultSet rs = stmt.executeQuery("SELECT SCOPE_IDENTITY()");
                System.out.println("Result "+rs);The primary key value is needed so that it can be used as a foregin key in another table. Am I going about this the correct way? Any help, pointers or code fixing would be appreciated.....

    Yes. I tried this way but I only ever get the answer
    of 0 when i print our the result! Not really sure
    whats happening.That's because you don't print a ResultSet like that. In order to get the key out, you have to do this:
    int key = 0;
    while (rs.next())
        key = rs.getInt(1);What were you thinking with your code?
    You might want to do this in a transaction. If the INSERT fails, you'll want to roll back.
    The "select @@identity" is correct for M$ Access, SQL Server, and Sybase. I believe it's also correct for MySQL, but I'm not 100% certain of that.
    %

  • Generate the primary key  automatically while records are saved

    Hi experts,
    I need to generate the primary key of a custom table automatically when a new record is saved. Pleas help asap. Urgent.

    Hi Rob and vikas,
       Thanks for your answers . Both of the solutions you mentioned were syntactically correct and activated but they are not populating the numbers.In case of Rob's soultion  I guess I am not able to catch the return number. I am giving the code below. So Please look into it,
    FORM gen_manu_siteid .
    data : number type zsiteid value 155.
    CALL FUNCTION 'NUMBER_GET_NEXT'
      EXPORTING
        NR_RANGE_NR                   = '02'
        OBJECT                        = 'zmanusite'
        QUANTITY                      = '1'
      SUBOBJECT                     = ' '
      TOYEAR                        = '0000'
      IGNORE_BUFFER                 = ' '
      IMPORTING
        NUMBER                        = number
      QUANTITY                      =
      RETURNCODE                    =
    EXCEPTIONS
      INTERVAL_NOT_FOUND            = 1
      NUMBER_RANGE_NOT_INTERN       = 2
      OBJECT_NOT_FOUND              = 3
      QUANTITY_IS_0                 = 4
      QUANTITY_IS_NOT_1             = 5
      INTERVAL_OVERFLOW             = 6
      BUFFER_OVERFLOW               = 7
      OTHERS                        = 8
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ztblqm_sqm-zsiteid = number .
    ENDFORM.                    " gen_manu_siteid
    When this did not work. i tried Vikas's soution and the code i used for this is
    FORM gen_manu_siteid .
    data : w_count like ztblqm_sqm-zsiteid,
           e_wa like ztblqm_sqm occurs 0 with header line.
    select max( zsiteid ) from ztblqm_sqm into w_count .
    w_count = w_count + 1.
    e_wa-zsiteid = w_count.
    modify ztblqm_sqm  from e_wa.
    ENDFORM.                    " gen_manu_siteid
    Please look into this and give me a solution.
    NB: I have tried them at the event 01 include.

  • HT201272 I am unable to make a purchase in an app on my secondary apple Id device but I can in the same app on the primary device

    I am unable to make a purchase in an app on my secondary apple I'd device, but I can in the same app from the primary advice. Can anyone tell me why and what can I do to solve this. I do not want to delete and reinstall as I will lose all my credits and progress. Thanks

    Then you should contact them:
    http://www.apple.com/emea/support/itunes/contact.html

  • Running Prime Infrastructure in HA mode but the primary server won't take over from the secondary

    We're running Cisco Prime Infrastructure 1.3 in High Availability mode, or atleast we're supposed to.
    At first everything seemed fine. We were using the primary server and the failover worked without a hitch when we tried it.
    Then the problems started. I think it was at the same time as we increased the disk-size and therefore had to fail over.
    When looking into the primary server using CLI everything seems fine but the service doesn't fail back to it. We've even tried to restart the secondary server in order to force the primary server to take over but it didn't work.
    In about 2 weeks we need to upgrade Prime and while doing that we would prefer to have our HA working so that we can continue monitoring our network.

    Hello,
    The below provided links might help you out :-
    http://www.cisco.com/en/US/docs/net_mgmt/prime/infrastructure/1.2/user/guide/maint_sys_health.html#wp1070549
    http://www.cisco.com/en/US/docs/net_mgmt/prime/infrastructure/1.3/release/notes/cpi_rn_13.html#wp79553

  • Do We still need Secondary Indexes on the cubes with BWA being Primary

    Hi Guru's
    Could you please suggest us, do you think we still need secondary Indexes on the cubes with BWA being Primary
    Regards
    Kumar

    Compression: DB statistics and DB indexes for the InfoCubes are less relevant once you use the BI Accelerator. In the standard case, you could even completely forgo these processes. However, note the following aspects:
    Compression is still necessary for inventory InfoCubes, for InfoCubes with a significant number of cancellation requests,
    and for InfoCubes with a high number of partitions in the F-table. Note that compression requires DB statistics and DB
    indexes (P-index).
    DB statistics are necessary in particular for real-time InfoCubes and reading the most current data.
    DB Indexes (index on the time dimension) are necessary in particular if the E fact table is not partitioned. Note also that you
    need compressed and indexed InfoCubes with up-to-date statistics whenever you switch off the BI Accelerator index.
    DB Indexes (index on the time dimension) are necessary in particular if the E fact table is not partitioned.
    Note also that you need compressed and indexed InfoCubes with up-to-date statistics whenever you switch off the BI
    Accelerator index.
    Please refer to the below link for useful information on BIA.
    http://www.sdn.sap.com/irj/sdn/bi?rid=/library/uuid/11c4b71d-0a01-0010-5ca0-aadc2415b137#q-3-2
    Hope this helps.

  • With 2 monitors, can I swap the primary and secondary screen?

    In other words, I have 2 different sized monitors, one running from ADC, the other DVI, but it is defaulting to using the smaller screen as the primary one which I don't want. I can't swap the leads round because I can't convert ADC to VGA so i need to do it inside of OS X. Is this possible? Cheers

    Open up the Displays System Preference and drag the screens to the proper place in order to change the screens around.

  • TS4020 I don't want to delete the secondary iCloud account? How do I change the primary account without deleting the old primary account!?

    We want to change the Primary iCloud account on one of the businesses computers and all it tells us is to delete it. We don't want to because we're afraid this will also delete all the meetings and other things saved on this account. Can anyone tell us how to simply change and not delete. Or can you let us know if you do lose anything if you delete an iCloud account??
    Thanks

    Never mind, I figured it out!

  • How to delete the double records connected to one or more than one tables in SQL 2008?

    Hi
    Can anyone please help me with the SQL query. I Im having a table called People with columns names: personno., lastname, firstname and so on. The personno. is having duplicate records,so all the duplicate records i have written with "double" in
    the beginning of the numbers. I tried deleting these double records but they are linked to one or more than one tables. I have to find out, all the tables blocking the deleting of double person. And then create select statements which creates update statements
    in order to replace the current id of double person with substitute id. (The personno. is in the form of id's in the database)
    Thanks

    You should not append "double" in the personno. When we append it will not be able to join or relate to other table. Keep the id as it is and use another field(STATUS) to mark as duplicate. Also we will require another field(PRIMARYID) against
    those duplicate rows i.e the main or the primary personno.
    SELECT * FROM OtherTable a INNER JOIN
    (SELECT personno, status, primaryid FROM PEOPLE WHERE status = 'Duplicate') b
    ON a.personno = b.personno
    UPDATE OtherTable SET personno = b.primaryid
    FROM OtherTable a INNER JOIN
    (SELECT personno, status, primaryid FROM PEOPLE WHERE status = 'Duplicate') b
    ON a.personno = b.personno
    NOTE: Please take backup before applying the query. This is not tested.
    Regards, RSingh

  • How do i use WGM or dcsl to change the primary groups of users, defined by another group?

    i've got a ton of users, whose primary group is "current student". they all belong to the other group "year 13"
    they've left school, so i thought it would be easy to do a search of users with GID equal to or containing the GID for "year 13" (in this case 1121) and then change their primary group to "left school"
    except that doesn't work. i can only search for them in WGM by primary group, it seems. therefore i cannot do any batch operations on a secondary group.
    so. how do i do this? is there a way of scripting dcsl to find users by 'other group' and then change the primary group attribute?
    i'm going to need to be doing a lot of this (changing the other gropus of a school full of students). bit stumped.
    help!

    ok. for some reason neitehr root nor my account (which is part of the open directory admin group) can make changes using dscl.
    when addingremoving users from groups, remember that teh UUID has to be added/removed too
    this is getting there:
    old=year11
    new=year12
    for item in `dscl /LDAPv3/127.0.0.1/ read /Groups/$old GroupMembership | cut -d: -f2`
    do
    echo $item
    UUID=`dsmemberutil getuuid -U $item`
    case "$UUID"
              in
              "There is no uuid for user $item")
                        echo "user $item need personal attention"
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 append /Groups/$new GroupMembership $item
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 append /Groups/$new GroupMembers $UUID
                        if [ "`dsmemberutil checkmembership -U $item -G $new`" == "user is a member of the group" ]  ; then
                        echo "$item added to $new"
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembership $item
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembers $UUID
                                  if [ "`dsmemberutil checkmembership -U $item -G $old`" == "user is a member of the group" ]  ; then
                                  echo "removal of $item from $old failed"
                                  else
                                  echo "removal of $item from $old succeded"
                                  fi
                        else echo "append of $item to $new failed"
                        fi
              esac
    done

Maybe you are looking for