Question on why LockMode.READ_UNCOMMITTED is waiting on read locks

Running je-5.0.103
We are running some load tests with multiple threads accessing our BDB. When we take a thread dump in the middle of the test we have noticed several of the threads waiting on a ReadLock even though we are using LockMode.READ_UNCOMMITTED.
The javadoc for LockMode states:
"With one exception, a record lock is always acquired when a record is read or written, and a cursor will always hold the lock as long as it is
positioned on the record.  The exception is when {@link #READ_UNCOMMITTED} is specified, which allows a record to be read without any locking."
Our load test is performing only reads and there should be no writes happening at all.
So the question is why are still acquiring read locks?  Is there some other configuration setting that we have that would override this or is the lock that we see in the thread dump a different lock?
Here is a sample thread waiting for a lock.
"EJB default - 126" prio=10 tid=0x00007f730c05f800 nid=0x5378 waiting on condition [0x00007f72af8c1000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00007f75568b4238> (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:964)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1282)
        at java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:731)
        at com.sleepycat.je.latch.SharedLatch.acquireShared(SharedLatch.java:149)
        at com.sleepycat.je.tree.IN.latchShared(IN.java:497)
        at com.sleepycat.je.tree.Tree.getRootINRootAlreadyLatched(Tree.java:2105)
        at com.sleepycat.je.tree.Tree.getRootINInternal(Tree.java:2087)
        at com.sleepycat.je.tree.Tree.getRootIN(Tree.java:2069)
        at com.sleepycat.je.tree.Tree.search(Tree.java:1237)
        at com.sleepycat.je.dbi.CursorImpl.searchAndPosition(CursorImpl.java:2118)
        at com.sleepycat.je.Cursor.searchInternal(Cursor.java:2822)
        at com.sleepycat.je.Cursor.searchAllowPhantoms(Cursor.java:2732)
        at com.sleepycat.je.Cursor.searchNoDups(Cursor.java:2586)
        at com.sleepycat.je.Cursor.dupsGetSearchKey(Cursor.java:3714)
        at com.sleepycat.je.Cursor.searchHandleDups(Cursor.java:3684)
        at com.sleepycat.je.Cursor.search(Cursor.java:2551)
        - locked <0x00007f74d7801d88> (a com.sleepycat.je.Cursor)
        at com.sleepycat.je.Database.get(Database.java:1294)
        at com.farecompare.atpcore.storageenginemodule.impl.berkeleydb.components.AtpRecordStore.getRecordsNoCursor(AtpRecordStore.java:215)
Our code snippet making the call:
private List<ATPRecord> getRecordsNoCursor( String key, Class<? extends ATPRecord> recordInterface ) throws StorageEngineException {
DatabaseEntry theKey = makeKey( key );
DatabaseEntry foundData = new DatabaseEntry();
List<ATPRecord> records = null;
OperationStatus retVal = getDatabase().get( null, theKey, foundData, LockMode.READ_UNCOMMITTED );   <<<<<< waits here
if ( retVal == OperationStatus.SUCCESS ) {
records = convertToRecordList( foundData.getData(), recordInterface );
else {
records = createRecordList( recordInterface, 0 );
return records;
Thanks,
Chris Stillwell

The call to IN.latchShared you're seeing is not a record lock, it's an internal latch on a Btree node.  Latching is not related to the lock mode.  This latch should be held for a short time, but in cases where many threads access the same records (or a very small set of records), you will see waiting on latches.  You can't disable latching -- thread safety requires it.
--mark

Similar Messages

  • Why DDL during SELECT is possible. Or why SELECT does not put a table lock?

    This is a question to people who really knows Oracle internals or/and RDB theory.
    (The question is relocated from another thread for not hijacking on that's original question.)
    Why DDL during SELECT is possible? Or why SELECT does not put TM 2 Row Shared lock on table(s)?
    This not locking causes a possibility while one session is running a long select, another can truncate and even drop table(s) that are being read by the first session.
    I think, humbly assume, that Oracle does not put TM 2 lock on tables, that are being simply SELECTed, by some significant technical reason. But I do not know this reason. If somebody knows please shed a light.
    Also, if you know that this behavior is totally correct from perspective of RDB theory, please explain me.
    I'll try to explain my point.
    It is a matter of data consistency and integrity that is supported in Oracle everywhere except this place.
    a) If one session is reading data from moment T and other session changes data on its way at moment T1, the first session wont read that changed data, it will read the data that was there on moment T.
    This is declared as Read Consistency principle.
    b) If one session is changing data, and another session tries to truncate or drop table - the second session will fail with error ORA-00054: resource busy and acquire with NOWAIT specified.
    This is declared as Data Integrity principle.
    c) But why not to follow the above principles in case when one session reads data and another session tries to truncate or drop table (or do other DDL operations)?
    It is counter-intuitive. Why not to put TM 2 (SS) lock during SELECT execution that would prevent DDLs on this table?
    What I only can assume is that this is only because some technical difficulty or limitation.
    What is this limitation or other reason in favor of which Oracle sacrificed consistency in this case?

    user11181920 wrote:
    Aman,
    There was no need to clarify how DML lock works, I know that.
    Also I know that in Oracle a Select does not lock neither table rows nor table itself.
    The reason I mentioned it because you brought up the word change which is far better suited for DML's than DDL's as the former has a requirement to have its Undo preserved.
    Again, my question was why Select does not protect itself by locking table(s), partitions and indexes?Protect from what? There is nothing wrong with doing a select. What would happen with a select doing a lock on the table before being executed in its entirety (forget DDL and DML altogether for a moment) ? State one good reason that there should be a lock for the select. If it has to, it would be always isn't it?
    The keyword here is concurrency and that's what is the best when the number of locks obtained are lesser at non-required operations. A select doesn't change anything that's why in Oracle, there is no read-level lock.I am not saying about row locks while reading. They are not needed because Undo resolves concurrency.Only in the case of DML where the change is still active and the buffers are dirty. With a DDL, its an implicit commit.
    I am asking why Select does not enqueue one, only one lock per object that participates in the Select?Again, my question back to you is, what good you would get from it? What purpose it would solve?
    It is not very expensive, I suppose. But it would protect from DDLs that can destroy the Select's result set. You have seen in your system and in my demo(and that's what the the question was on the other thread also) that the result remains intact and its not a behavior from now. Its the same since the time I have started learning Oracle. Can you explain that why you think that the result of select statement would be wrong for a drop table? I believe, its been stated repeatedly that if the select has no requirement to look back the table, it would get completed. Only if the select needs to access the table again, it would fail. So even if we consider your explanation, there is no wrong result shown at all. Once the session encounters that the table is dropped for the statement, the execution stops right away. So where is the destroyed result?
    Yes, it is less dangerous when Select does not lock table comparing with what would happen with DMLs in such case (that is why DMLs protect themselves by TM 3), it affects only the Select and its consumer, but still ... I don't understand this Oracle's decision. What is a reasoning behind it?.As I said, to improve concurrency.
    Aman....

  • Why my Firefox always lack and why I have to wait for minutes to open a page?

    Dear customer support officer,
    Why my Firefox always lack after I have update with Window 7 Service Pack 1? ... and why I have to wait for minutes to open a page?
    I discovered from the "Task Manager", every time when Firefox is lack, it took up 100% of my "CPU Useage".
    Below, kindly find my version spec for your investigation convenience. Many thanks in advance for your prompt support : )
    Sincerely yours,
    Charmayne
    Application Basics
    Name
    Firefox
    Version
    5.0
    User Agent
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
    Profile Directory
    Open Containing Folder
    Enabled Plugins
    about:plugins
    Build Configuration
    about:buildconfig
    Extensions
    Name
    Version
    Enabled
    ID
    Better Facebook!
    5.852
    true
    [email protected]
    Java Console
    6.0.20
    true
    {CAFEEFAC-0016-0000-0020-ABCDEFFEDCBA}
    Java Console
    6.0.22
    true
    {CAFEEFAC-0016-0000-0022-ABCDEFFEDCBA}
    Java Console
    6.0.23
    true
    {CAFEEFAC-0016-0000-0023-ABCDEFFEDCBA}
    Java Console
    6.0.24
    true
    {CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}
    Java Console
    6.0.26
    true
    {CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}
    RealPlayer Browser Record Plugin
    14.0.3
    false
    {ABDE892B-13A8-4d1b-88E6-365A6E755758}
    Modified Preferences
    Name
    Value
    accessibility.blockautorefresh
    true
    accessibility.typeaheadfind
    true
    accessibility.typeaheadfind.flashBar
    0
    browser.history_expire_days.mirror
    180
    browser.places.smartBookmarksVersion
    2
    browser.startup.homepage
    http://www.google.com/webhp?hl=en
    browser.startup.homepage_override.buildID
    20110615151330
    browser.startup.homepage_override.mstone
    rv:5.0
    browser.tabs.loadInBackground
    false
    dom.disable_open_during_load
    false
    extensions.lastAppVersion
    5.0
    keyword.URL
    http://mystart.incredimail.com/?loc=ff_address_bar&a=ICetqQnqJ0&search=
    network.cookie.prefsMigrated
    true
    places.database.lastMaintenance
    1311818987
    places.history.expiration.transient_current_max_pages
    64401
    places.last_vacuum
    1298980389
    print.print_printer
    Microsoft XPS Document Writer
    print.printer_Microsoft_XPS_Document_Writer.print_bgcolor
    false
    print.printer_Microsoft_XPS_Document_Writer.print_bgimages
    false
    print.printer_Microsoft_XPS_Document_Writer.print_command
    print.printer_Microsoft_XPS_Document_Writer.print_downloadfonts
    false
    print.printer_Microsoft_XPS_Document_Writer.print_edge_bottom
    0
    print.printer_Microsoft_XPS_Document_Writer.print_edge_left
    0
    print.printer_Microsoft_XPS_Document_Writer.print_edge_right
    0
    print.printer_Microsoft_XPS_Document_Writer.print_edge_top
    0
    print.printer_Microsoft_XPS_Document_Writer.print_evenpages
    true
    print.printer_Microsoft_XPS_Document_Writer.print_footercenter
    print.printer_Microsoft_XPS_Document_Writer.print_footerleft
    &PT
    print.printer_Microsoft_XPS_Document_Writer.print_footerright
    &D
    print.printer_Microsoft_XPS_Document_Writer.print_headercenter
    print.printer_Microsoft_XPS_Document_Writer.print_headerleft
    &T
    print.printer_Microsoft_XPS_Document_Writer.print_headerright
    &U
    print.printer_Microsoft_XPS_Document_Writer.print_in_color
    true
    print.printer_Microsoft_XPS_Document_Writer.print_margin_bottom
    0.5
    print.printer_Microsoft_XPS_Document_Writer.print_margin_left
    0.5
    print.printer_Microsoft_XPS_Document_Writer.print_margin_right
    0.5
    print.printer_Microsoft_XPS_Document_Writer.print_margin_top
    0.5
    print.printer_Microsoft_XPS_Document_Writer.print_oddpages
    true
    print.printer_Microsoft_XPS_Document_Writer.print_orientation
    0
    print.printer_Microsoft_XPS_Document_Writer.print_pagedelay
    500
    print.printer_Microsoft_XPS_Document_Writer.print_paper_data
    1
    print.printer_Microsoft_XPS_Document_Writer.print_paper_height
    11.00
    print.printer_Microsoft_XPS_Document_Writer.print_paper_size_type
    0
    print.printer_Microsoft_XPS_Document_Writer.print_paper_size_unit
    0
    print.printer_Microsoft_XPS_Document_Writer.print_paper_width
    8.50
    print.printer_Microsoft_XPS_Document_Writer.print_reversed
    false
    print.printer_Microsoft_XPS_Document_Writer.print_scaling
    1.00
    print.printer_Microsoft_XPS_Document_Writer.print_shrink_to_fit
    false
    print.printer_Microsoft_XPS_Document_Writer.print_to_file
    false
    print.printer_Microsoft_XPS_Document_Writer.print_unwriteable_margin_bottom
    0
    print.printer_Microsoft_XPS_Document_Writer.print_unwriteable_margin_left
    0
    print.printer_Microsoft_XPS_Document_Writer.print_unwriteable_margin_right
    0
    print.printer_Microsoft_XPS_Document_Writer.print_unwriteable_margin_top
    0
    privacy.sanitize.migrateFx3Prefs
    true
    security.default_personal_cert
    Select Automatically
    security.warn_viewing_mixed
    false
    Graphics
    Adapter Description
    NVIDIA GeForce G102M
    Vendor ID
    10de
    Device ID
    0873
    Adapter RAM
    512
    Adapter Drivers
    nvd3dumx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2um
    Driver Version
    8.15.11.8631
    Driver Date
    7-1-2009
    Direct2D Enabled
    Blocked on your graphics driver. Try updating your graphics driver to version 257.21 or newer.
    DirectWrite Enabled
    false (6.1.7601.17563, font cache n/a)
    WebGL Renderer
    (WebGL unavailable)
    GPU Accelerated Windows
    0/1

    upgrade your browser to Firefox 8 and check
    * getfirefox.com

  • I have a DVD I recorded from my tv.  I am trying to make copies and when I insert the DVD I get a message saying it is blank even though it is not.  My question are: Why does my computer think it's blank? And how can I copy a DVD?

    I have a DVD I recorded from my tv.  I am trying to make copies and when I insert the DVD, I get a message saying the DVD is blank, which it is not.  My questions are: Why does my computer think it's blank?  And how can I copy the DVD providing my computer recognizes there is content on it?
    Thanks, Sheila

    TV video typically is copyrighted content.  We'd be breaking several rules trying to help you.  Good luck!

  • Andriod and windows phones have an option in whatsapp to send songs then my question is why not from ios ?

    andriod and windows phones have an option in whatsapp to send songs then my question is why not from ios ?

    ok thanks
    but there should some app by which it can be send

  • A logical question about why we update firmware

    just being real here
    we all like the latest and greatest products, especially mobiles, and we all know they have their share of isues. but yet still we buy even though the device we owned previously worked fine or almost something like 90%.
    the question is why do we buy these devices, then depend on firmware updates that sometimes improves speed, or maybe add a couple apps, but doesn't solve the bugs. why do we even bother to update. do we have to. if our phone is working ok, why go through the update process, lose all our installed apps, and then start encountering problems we never had before.
    it is just a strange price we pay for technology. remember before firmware updates were available, our phones worked great. no worrying about wi-fi connection problems, or camera bugs, or widgets not loading, or phone constantly crashing and rebooting on its own. why can't we get a phone that works 100%, especially when we shell out up to $600us or sometimes more.
    when i new update is released i am hesitant to go through it, but in the end still do. sad but true. so the question is, WHY?
    Message Edited by coopere on 06-Jul-2009 05:13 PM
    everything happens for a reason
    check out my blog @ http://mycellife.blogspot.com/

    Good question ;-)
    That question is more philosophical than mobile-related I think. That´s how people work and that´s how our market system works. People always want to have the newest gadgets, the latest technologies etc. Sometimes they´re better, sometimes not, but whether a product succeeds in the marketplace is not always about quality.
    Demand creates offerings. If there wasn´t any demand for newer mobiles, there wouldn´t be any.
    Regards,
    Hendikoischnur
    IT will paint our future - either green or black
    * ecosia, the eco-friendly search engine (powered by Yahoo/Bing/WWF);
    * Searching for pics online? Try ecocho.eu or treehoo.com
    * For those who don´t want to miss Google: Try znout.de - it´s Google running on green energy
    * CO2-free chatting: Try Jabber-server.de (running on 100% waterpower)

  • Why do we need to take a lock before invoking wait()/notify() on an Objec

    Hi,
    Why do we need to take a lock before invoking wait()/notify() on an Object? i know that we shud take otherwise illegalstateexception is thrown.
    what is the reason to take a lock bfefore invoking the above methods. why does jvm expects from the programmer?
    Cheers,
    duggana.

    Well, very often a wait or notify is conditional on the state of some flag (semaphore) which is protected by the monitor. By putting the wait in a synchronized section you guarantee that the sempaphore won't change between the final test of it and the actual wait or notify, otherwise a notify might be lost and the program hang.
    // wait on semaphor
    if (!canProcede)
       synchronized(this)
           if(!canProcede)
              wait();
    //   release semaphor
    synchronized(this)
         if(!canProceed) {
              canProede = true;
              notify();
        }If the wait above wasn't guarded by the sychrozined it's possible the second code fragment might be executed between the test and the wait, in which case the wait would be called after the notify and, hence, wait for ever.

  • Why do we need to take a lock before invoking wait()/notify() on an Object?

    Hi,
    Why do we need to take a lock before invoking wait()/notify() on an Object? i know that we shud take otherwise illegalstateexception is thrown.
    what is the reason to take a lock bfefore invoking the above methods. why does jvm expects from the programmer?

    Please do not crosspost..

  • I have an email account on qou but all the incoming emails subject and body appear as question marks, why???

    I have an email account on QOU (al-quds Open University) but all the incoming emails subject and body appear as question marks, why???

    Try to set the Boolean pref <b>gfx.font_rendering.directwrite.use_gdi_table_loading</b> to <i>false</i> on the <b>about:config</b> page.
    *http://kb.mozillazine.org/about:config
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    Try to disable hardware acceleration.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"

  • I love osx mountain lion my question is why was air play taken out of specific app like quick time and iTunes i dont always want to display my whole computer when i am in airplay mode

    i love osx mountain lion my question is why was air play taken out of specific app like quick time and iTunes i dont always want to display my whole computer when i am in airplay mode

    Funny, my iTunes still has AirPlay capability without AirPlay Mirroring active.

  • Well I have a question. Why my New iPad is so hot within 30 minutes.i used internet from wifi and playing game 3d or 2d . It

    Well I have a question. Why my New iPad is so hot within 30 minutes.i used internet from wifi and playing game 3d or 2d . It's appear after I upgrade to IOS6. Why?

    It's normal for the iPad or any similar device to get warm when it's under heavy load. If it gets too warm, it will shut itself off and show a disabled message.
    Take a look at this Apple doc -> Phone, iPad, and iPod touch (4th generation): Keeping device within acceptable operating temperatures
    If you believe it's hotter than normal, make a reservation with a Genius.

  • I exceeded my security questions . Do I have to wait 8 hours to reset them?

    I exceeded my security questions . Do I have to wait 8 hours to reset them?

    The Three Best Alternatives for Security Questions and Rescue Mail
        1. Use Apple's Express Lane.
              Go to https://expresslane.apple.com ; click 'See all products and services' at the
              bottom of the page. In the next page click 'More Products and Services, then
              'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
              ID security questions' and click 'Continue'. Please be patient waiting for the return
              phone call. It will come in time depending on how heavily the servers are being hit.
         2.  Call Apple Support in your country: Customer Service: Contact Apple support.
         3.  Rescue email address and how to reset Apple ID security questions.
    A substitute for using the security questions is to use 2-step verification:
    Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID.

  • Why is Launchpad in Waiting mode? Also, other apps didn't update although it says they did.

    On a late 2009 iMac. Yosemite.
    Updated a few apps the other day, or so I thought.
    Just noticed that Launchpad says "waiting" and the apps that I updated, did not update.
    See attached photos. Anyone have a fix? Thanks.

    I figured it out. Looking at the Launchpad, I realized it looks like my iPads, so I decided to see if I could hold down the App that was in "waiting" mode.... just as you could do in IOS.
    Sure enough, I put my mouse pointer on the app in question and held it there. Then all the apps began to "wiggle" like they do in IOS.
    A little  " X " appeared so I clicked it, and a window came up asking if I was sure I wanted to delete the app. I clicked yes and it fixed the problem. No more stuck app and no more launchpad in waiting mode.

  • Why does it say waiting for activation under facetime switch

    why cant i access facetime and why does it say waiting for activation under the facetime switch?

    Hi,
    If you have  a Jabber ID used in iChat and you add a Buddy the Buddy gets an Authorisation Request invite.
    iChat sends this Invite once.
    The Buddy cannot be properly in your Buddy List until they accept.
    However other Jabber Apps constantly sends the Authorisation Requests again and again until the person Accepts or Declines.
    In iChat if the Buddy misses the Request the Buddy list is left hanging with the "Awaiting" message.
    GoogleTalk and Facebook IDs ware valid Jabber names if you have Enable "Talk" on Google an "Chat" on Facebook.
    Try Deleting the Buddy from the list (Highlight and then Backspace key)
    Then Add them when you know they will see the request.
    (Or get a Third Party Jabber app and run that after adding their name until they reply)
    10:01 PM      Saturday; October 6, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • I'm using firefox version 6 and for the last three days the add-ons manager page won't load. my question is why won't the add-ons page load? is the server down on your end?

    i'm using firefox version 6 and for the last three days the add-ons manager page won't load. my question is why won't the add-ons page load? is the server down on your end?

    Click on something below the Get Add-ons menu item on the left side of the Add-ons Manager tab.

Maybe you are looking for

  • How to let Trinidad Tag use outside css classes instead of skin?

    In my project, we asked vendor company to create the UI and css of the whole web application. We are using Trinidad in the project, trinidad use skin to customize the look and feel of the page. Since we have already had a set of css classes, we don't

  • Apple TV3 and the New iPad - I  WANT to stream the sound only

    Hey guys! I've got the new iPad and apple tv 3 which is great together! I have a receiver (which is located in the living room)  with Zone2 option and also have outdoor speakers which are connected to that Zone2. When I sit outside i want to use my g

  • Error for adobe flash player

    dear Adobe staff, i correctly downloaded adobe flash player 11, after formatting my pc but i have a problem. youtube website correctly works but megavideo won't go giving the following error message: you need a newer flash player version to use this

  • Java vs Javascript NOT THE SAME THING

    Since we're all just users here it might be appropriate to remind people that Java and Javascript are two distinctly different things. With the recent warnings about Java some might be inclined to also disable Javascript in their browsers. There is n

  • How do you configure DHCP server on OSX Lion Server

    I want to use my Mac Mini Server as a DHCP server on my network.   I cannot find the place under Server to configure it.   Where would I find it?   It is not under Server.