Berkeley DB needs too many write locks on specific size of the records

Hi,
I put records to the Berkeley db row by row in single transaction. And i have discovered significant increase of write locks on some specific size of the data.
For example when i put 1000 records, where each record data size is around 3500 bytes, transaction uses 428 locks. On bigger or smaller data size transaction needs fewer locks.
I put statistic in the table:
Record size Lock number needed by transaction
~1400 169
~3500 428
~4300 6
I think it is somehow related to the page size(16384) or cache size (64Mb)
Could someone explain why transaction needs so many write locks with data size ~3500 and fewer locks with data size ~4300?
Is there any way to avoid that raise of lock number? If not, I need to measure maximum number of locks needed for successful end of transactions. Understanding of the source of that issue would help me to prepare data which require the biggest number of locks for putting it in the database in one transaction.
Thanks in advance.

Please delete this post and repost in the appropriate forum. Thank you.

Similar Messages

  • DB need too many locks in single threaded application

    Hello,
    I`m new to BDB, and search for help of gurus.
    I try to create database importing data from csv files. Import procedure is already written and works fine, but sometimes it starts to need too many locks.
    Import process read csv file line by line. Check if key is already in the database, if yes it updates data, otherwise create new record. Import procedure is using DBEnv and transaction.
    Please, look at 2 cases of data to import.
    Case 1: Data in csv files are like:
    key1, some_data_1
    key1, some_data_2
    key2, some_data_3
    key2, some_data_4
    keyN, some_data_2N-1
    keyN, some_data_2N
    (key became a key and data became the value in the database)
    Case 2: Remove each second line in the csv file, so it became:
    key1, some_data_1
    key2, some_data_3
    keyN, some_data_2N-1
    In this case for successful import of the file more locks are needed then in case 1.
    This seems very odd to me. Could somebody explain why lock system behave so? Looking forward to hearing any response.
    Thanks.
    p.s.: maybe my explanation is not very clear, but i don't know which other details are really important. I could provide more details if it could help.
    Message was edited by:
    user647892

    There is nothing wrong.
    Oracle by default locks records. In case 1, you insert a record (1 row level lock) and update that same record. Why is a mystery, but the update doesn't require a lock (by you) as you already did lock the record.
    In case 2, you have distinct keys for each line, so each line results in a row level lock as expected.
    There are as much record locks as you request it to make.
    You could consider locking the table explicitly once, prior to the transaction, by a lock table statement.
    However, your approach is fundamentally flawed an non-scalable, as it processes each line individually instead of loading the data in a staging table and transferring it to the production table using
    insert into production table
    select * from staging table
    where key not in (select key from product table)
    Sybrand Bakker
    Senior Oracle DBA

  • How do you set up iCloud on the iPod touch if it says too many apple accounts have been signed onto the device

    How do you set up iCloud on the iPod touch if it says too many apple accounts have been signed onto the device.

    Welcome to the Apple community.
    Unfortunately you will need to create your Apple ID (account) on another mobile device or a Mac computer. Once three iCloud accounts have been created on an iOS device, it doesn't matter what you do to that device, no further accounts can be created on it.

  • How can I tell which apps or programs are open at any time. At a recent visit to the Genius at my local Apple store, the "Genius" told me that too many apps or programs are running in the background. I'm using Mountain Lion on a McBook Pro

    I was told that my Mac has to work extra hard because there are too many apps and/or programs open in the background. How can one tell what is open?? It must be something which is not normally visible to the user??
    Hans

    Thanks, I have looked at that several times but I can't detect any one item which would indicate overusage. The small chart (indicator bars) are much on the low side and the onse which show are basically green? Not sure what the person at the Genius Bar saw so I'm somewhat puzzled.

  • Too many Oracle Locks

    Hi Guys,
    We are facing this situation where in our Prod environment is getting many many Oracle Locks.
    Users are not able to perform their work smoothly and this hits hard during the month ends.
    DB Version= 10.2.0.4
    Apps Version = 11.5.10.2
    I have performed some investigation and found the below:-
    - The users perform certain operations and it is during this operation that we start getting Oracle locks frequently.
    - This issue cannot be recreated in any lower instance.
    - The sessions that are blocking are INACTIVE sessions with module 'ARXCWMAI'.
    - The sql that is run is also a select query (does not look like a problem area)
    - Trace/tkprof do not have enough information.
    - These sessions also tend to lock the table AR.AR_PAYMENT_SCHEDULES_ALL (found from v$locked_object)
    - These blocking sessions are killed and thats the temporary solution.
    Any ideas or suggestions would be greatly appreciated!
    Thanks,
    Trith

    Trith wrote:
    Pierre, How do I go forward after taking the backups of session,sql and lock tables.
    First goal should be to know what kind of lock type is blocking in your case and what is the related database object.
    To do this you need to understand how Oracle locking works, how different locks are represented in V$LOCK and how to check blocker/blocking session in V$LOCK. First step is to read relevant Concepts Guide section and try the examples and checking at the same time what is exactly in V$LOCK: http://docs.oracle.com/cd/E11882_01/server.112/e25789/consist.htm#i5704. Especiially you need to understand TM and TX lock types and to check what kind of blocking locks you have in your case.
    Other very good documentation about Oracle locking can be found in Tom Kyte Expert Oracle Database Architecture and Jonathan Lewis Oracle Core books. If you have access to My Oracle Support there are also some good notes on Oracle locking.
    Edited by: P. Forstmann on 14 mars 2012 13:52
    Edited by: P. Forstmann on 14 mars 2012 14:04

  • Too many recipients found for message type in the ALE model

    Hello Friends,
                            Please help me in solving this error. I have a Outbound sales order confirmation ORDRSP  .
    In the distribution model i have defined the sender receiver and message type clearly...
    But  in va01  after creating sales order  extras ->Output->Hearder --->Edit
    Output type-- BA00
    medium --ALE
    Dispatch time : Send Immediately
    I am getting a error -
    Too many recipients found for message type ORDRSP in the ALE model
    Message no. B1130
    Diagnosis
    In the ALE distribution customer model several recipient systems for IDOCs with message type ORDRSP and filter object type 'KUNNR' with value '100' have been modeled from this system, but only one recipient system is allowed.
    Procedure
    Please change the ALE distribution customer model so that it allows only one recipient system for the message from this system.
    Please help me in solving this error.
    Regards,
    jeevan

    Hi Jeevan,
    In BD64, the said problem occurs, since the message type ORDRSP will be configured to different Logical System.
    Since you are creating sales orders & Output type, system doesnt knows, to which Logical system, it has to be sent since the Message type exists more than once.
    select Your respective Logical System where the Outbound Sales Order Confirmation ORDRSP has been created.
    Under the node ORDRSP, add the filter group for Customer.
    Double click the Filter group and add the respective Customer No.s to whom the Order confirmation needs to be sent.
    Then create Sales Order Confirmation & Output type. Data will be passed(IDoc) to the respective Customer(where the customer no.) exist in the filter.
    Hope it solves your Issues.
    Regards,
    Anbalagan.

  • What do I do when iTunes App Store says too many http redirects when I click on the data categories or top 25 tabs

    I updated my iOS and downloaded some apps and then when I click on catagories or top 25 in the App Store it says too many http redirects.

    Clean the cookies and data, and also your history going on Settings>Safari.

  • HT6020 Entered wrong code too many times and when I was trying the right way now it asks me to contact support

    I entered iCloud key chain code wrong too many times and now when I am entering the right way it's asking me to contact support

    Hello, Maddineniramu. 
    Thank you for visiting Apple Support Communities.
    I would recommend reaching out to us via the link below to assist you with this issue.
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Cheers,
    Jason H.

  • Does having too many apps (like more than 100) affect the iPod Touch 5g's battery

    So with today being the App Store's 5 year anniversary, there are a LOT of top notch apps becoming free, which I have wanted.
    However this worries me - can having too many apps downloaded affect my iPod Touch 5g's performance & battery life?
    Extra Details:
    iPod Touch 5g 32gb, just got it two days ago.
    iI already have over 70 apps

    I say they will only adversely effect performance and battery life if the apps do things when the apps are completely shut down. By shutdown I mean the app are not in the recently used row when yo double click the Homne button. By doing something I mean that sme apps are always checking for things like when you get a notification.

  • HT5312 I can't look at my security questions because i incorrectly answered them too many times though it would not save the changes i made?

    I want to be able to change my security questions and answers

    You will need to contact iTunes Support or Apple to get the questions reset.
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then 'Forgotten Apple ID security questions'
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57
    When they've been reset you can then use the steps half-way down the page that you posted from to add a rescue email address for potential future use, or you could change to 2-step verification : http://support.apple.com/kb/HT5570

  • About to lock a specific app on the phone

    I would like to know if there is a way to make a lock on a app. Like i have the amazon app in i want it to be locked is there a way to lock a specific app?

    No

  • How to get info who is locking a specific row in the RDBMS 9i?

    Hi,
    could some one please helop me with this? I would like to know the Oracle user name of the user who is locking a specific row in my table. I can display all locking requests with the following SQL statements. What I could not igure out how to find the rownum that is being locked by others?
    SELECT *
    FROM v$lock lk, v$session s , DBA_OBJECTS ao, wf_users wu
    WHERE lk.lmode > 1
    AND s.username IS NOT NULL
    AND lk.SID = s.SID
    AND ao.OBJECT_ID(+) = lk.id1
    AND s.username = wu.NAME(+)
    AND ao.owner = USER
    AND ao.object_name = 'BWF_IKTATASI_ADATLAPOK';
    Thank you in advance,
    Tamas Szecsy

    I'm not sure what's happening with your app. I wrote on up to see if it could handle the CTRL-C. Seems to work fine. Do you have any other JMenuItems with the same accelerator?
    import java.awt.event.*;
    import javax.swing.*;
    public class Copy extends JFrame {
         public Copy() {
              this.initMenuBar();
              this.setSize(400, 300);
              this.setVisible(true);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         private void initMenuBar() {
              JMenuBar menubar = new JMenuBar();
              JMenu edit = new JMenu("Edit");
              JMenuItem copy = new JMenuItem(new CopyAction("Copy"));
              edit.setMnemonic(KeyEvent.VK_E);
              copy.setMnemonic(KeyEvent.VK_C);
              copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));
              edit.add(copy);
              menubar.add(edit);
              this.setJMenuBar(menubar);
         public static void main(String[] args) {
              new Copy();
         private class CopyAction extends AbstractAction {
              public CopyAction(String label) {
                   super(label);
              public void actionPerformed(ActionEvent e) {
                   System.out.println("Action Performed.");
    }

  • How do I turn off Adobe Flash - too many sites have Flash Advertisements which slow the browser to less than a crawl.

    Some pages have 3, 4, 5 or more adobe flash advertisements running at the same time, which slows the browser down tremendously. Then, if you happen to have multiple tabs open, the browser crawls to a virtual standstill, and many times, stops responding at all.
    I would like to be able to choose whether or not a page can run flash content - not have it be something that runs all the time for every page, with the only option being to kill the plugincontainer process in taskmanager - which kills even the Adobe Flash items you might want to view; such as a youtube video.
    Why is there not a way to turn Adobe Flash off in the browser? I have updated both Firefox and Adobe Flash but nowhere is there an option for turning it on or off depending on your needs.
    Can a control be added to the Internet Options, that you can set, to have a page ask before it is allowed to run Flash Content? Having that kind of control would GREATLY enhance the enjoyment of browsing multiple pages.
    Any information on how to do this, would be appreciated.

    That seems to have done the trick. Thank you.
    I guess it would have been too simple for it to have the same name. I was looking for Adobe Flash, whereas Firefox's add-ons manager page calls it Shockwave Flash.
    Kind of hard to see an orange when the only label the box has is grape. :)
    I truly appreciate your help.

  • Too many anchor points, and simplify messes up the pic

    I'm making a picture and I have a problem - I need a maximum of 2000 anchor points, and I have about 11k.
    Seems like I have a lot of unnecessary points, but when I try to simplify the picture gets all messed up. Any other way to fix this?
    Here's part of the picture, you can clearly see that a lot of the points don't have to be there..

    It looks as if you have a lot of areas with the same color inside itself...
    And/or different colors hidden by overlaps.--which is exactly why I said the Merge Pathfinder will probably reduce the number of anchors. There is no need to tediously select objects of same color. Merge unions adjacent areas of same color and removes hidden areas of overlap in one move.
    Photo of a heart...
    That could be anything from a valentine to a medical procedure photo. You need to show what you're working with.
    This picture project is such a huge pain in the *ss...
    So is trying to help someone, blind.
    JET

  • How do I install PageMaker 7 on a new laptop with Windows 8.1?  Too many files, and nothing brings me to the registration menu.

    I am at my wits end trying to install PageMaker 7.0 on my new laptop with System 8.1.  When the disk is inserted, there is a long list of files.  Other times it takes me to the Installation menu - which will not open when I click on it.
    My PC is also system 8.1, and somehow the place I bought it from installed PageMaker and it works fine.
    I hope you'll email me a response.  I don't want to have to keep logging on here to search for an answer.  Adobe won't help me.
    Help.
    Sherry
    [email protected]

    Pagemaker is ancient, obsolete and unsupported. It was discontinued over 10 years ago. (Though why it is still sold is a mystery.)
    If you want to run PageMaker, your best bet is to use a Win2K or WinXP PC.
    Otherwise move to Indesign or look at Serif's PagePlus or Scribus.

Maybe you are looking for

  • Year pass not working

    This si the thrid year in a row when Telstar has tried unsucceessfully to run this NRl pass.  Its still just as frustratingly hopeless as it always has been, possibly worse. Why is Telstra and its employees so hopelessly incompetent across every prod

  • My app store icon is gone as well as my safari app

    My App Store and Safari apps are gone

  • I want an answer urgent for this Error

    Hi all I am using MS Access as a database In my JSP code when i used one query or many updates, that works fine. However, when i use two queries, it shows the following error. By the way, i tried to use different connections and the same connection a

  • Get 2 pages when I preview

    I designed a print layout. when I preview the layout with 1 row of data, found I get 2 pages and the second page only shows page header. I adjust the height, width and position of some objects, but it's useless. can anyone tell me what can I do to fi

  • Reflective Method Invocation

    can someone please explain this concept to me? may be with some code. apparently java 1.4 is much more efficient at this. thanks, erik