Locking misunderstanding, please help.

I am trying to test locking in coherence. To do this I am creating 2 threads each of which try to obtain a lock. One of them should fail, no? Code is below:
     <code>
     public void testLocking() {
     Thread a = new Thread("thread a") {
     public void run() {
     NamedCache testCache = CacheFactory.getCache("test");
     assertTrue(testCache.lock("test"));
     Thread b = new Thread( "thread b" ) {
     public void run() {
     NamedCache testCache = CacheFactory.getCache( "test" );
     assertTrue( testCache.lock( "test" ) );
     a.start();
     b.start();
     try {
     a.join();
     b.join();
     catch (InterruptedException e) {
     throw new RuntimeException(e.toString());
     </code>
     They cannot both lock the same object, can they?

I would add some more debugging output to it. The lock may have a timeout set, for example (see the standard lease millis setting in tangosol-coherence.xml; set it to zero to hold locks indefinitely). Also, in 2.3, locking can be at the granularity of the member, but I assume you're not setting that.
     When I run it (using Base.azzert method instead of assertTrue, since I'm not using jUnit for this):
     <code><pre>Tangosol Coherence Version 2.3/267c
     Assertion failed: testCache.lock( "test" )
     at com.tangosol.tests.TestCam$2.run(TestCam.java:40)
     com.tangosol.util.AssertionException: Assertion failed: testCache.lock( "test" )
     at com.tangosol.util.Base.azzert(Base.java:181)
     at com.tangosol.util.Base.azzert(Base.java:161)
     at com.tangosol.tests.TestCam$2.run(TestCam.java:40)</pre></code>

Similar Messages

  • For some reason I cannot delete files off my desktop without putting my password in and even when I do I still can't delete and I also can't put files on my desktop at all ! but when I look at my desktop it gives me a silver lock? Please help me?

    when I go to find my desktop in Finder it shows a folder and a silver lock ? PLEASE HELP ME !

    If the light will not turn on the TC is dead. No matter that the hard disk is running.. it should only run at start up or when it is accessed not constantly.. that means the board in the TC has failed. Apple do not repair them.. They will replace it under warranty or applecare.
    If you have gone over the 12month warranty it will still be covered if you have applecare on any computer or an Apple TV. In fact the cost of the apple TV plus apple care is still cheaper than buying a new TC.. so it is a route some people are taking.. certainly depends.. in some places like Europe or Australia now, there is a recognition that statutory warranty must be longer on a product that is premium to the market. 12months is not good enough. Apple will sometimes listen.
    They might be fixable but I do not know how.

  • TS3920 I have a problem after I lock my iphone or it is automatically locked , the time doesn't update. It just freezes at the last time of locking. Please help , it is iphone 5 running iOS7.1

    I have a problem after I lock my iphone or it is automatically locked , the time doesn't update. It just freezes at the last time of locking. Please help , it is iphone 5 running iOS7.1
    I check with my service provider as well as I synchronized with iTunes , changed time manually with the right time zone. Unfortunately the problem keeps showing

    Hi Courcoul
    Thanks for stepping by
    To tell the truth I forgot to mention that I already did what you said, even more I tried all "reset" options including:
    Reset all settings
    Erase All content and settings
    Reset Network settings
    Etc
    Even
    Reset location and Privacy
    It keeps showing the problem

  • After upgrading to Mavericks my Mac Pro does not open my double CD drives when I hit eject in the menu bar it locks up (please Help)?

    After upgrading to Mavericks my Mac Pro does not open my double CD drives when I hit eject in the menu bar it locks up (please Help)?

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter "BOOT_TIME" (without the quotes) in the search box. Note the timestamps of those log messages, which refer to the times when the system was booted. Now clear the search box and scroll back in the log to the last boot time after  you had the problem. Select the messages logged before the boot, while the system was unresponsive or was failing to shut down. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V). Please include the BOOT_TIME message at the end of the log extract.
    If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    Still in Console, look under System Diagnostic Reports for crash or panic logs, and post the entire contents of the most recent one, if any. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if present (it may not be.) Please don’t post any other kind of report — it will be very long and not helpful.

  • Ipod Nano Locked Up PLEASE HELP!!!

    Ok, I purchased a second generation 4gig green Ipod nano on Monday. For some strange reason today it locked up. Now it refuses to work at all. It is stuck with the backlight on and the music paused. I do not know what I did worng or if it is my Ipod. It was working perfectly. Then I pressed pause and it screwed up. If nobody can help me by tommorrow I will have to take it back. Also, my computer just managed to detect it. It told me I should restore it so I told it yes. Now it keeps having the error message "There was a problem downloading the iPod software for the iPod "iPod". The requested resource was not found." Somebody please help me.
      Windows Vista  

    Igor, could you tell me what you did to fix it? My
    iPod fell out of my locker and now my iPod's stuck on
    hold!
    Are yu saying that the hold switch doesn't work to get it out of "Hold"? Have you tried (with the hold switch in the left or off position) to reset it: press and hold Menu and Select (center) buttons at the same time for at least 6 seconds?

  • HT1212 my ipod is disabled for years, i plugged it into itunes and it says it cant do anything because the ipod is locked. Please help me!!!

    hello, my ipod got disabled for years. Right now its disabled for 22,817,472. I asked around and people said to just restore it on itunes. But when i plug it in it says that it cant connect it the ipod because its locked with a passcode. Someone please please help me!!!!

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    Forgotten Restrictions Passcode Help
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    Also, see iTunes- Restoring iOS software.

  • IPhone activation lock problem please help

    My friend has bougth an iPhone 5 with iOS 7 through OLX . OLX is a website like craiglist where people buy there products directly to sellers.
    iPhone 5 when he bougth was good and was in working condition. He bougth it yesterday.But suddenly in the nigth he got a maessage that "message from iPhone owner that your iPhone is lost " and the iPhone has been stuck in the activation lock and is asking for the apple id of the consumer and the owner of th phone from whome he has bougth has stopped responding.
    Please help him to get out of this problem .I have bougth ut by paying full price is there any way apple will help me in this issue or is there any way i can activate my iPhone.
    Please help. Thnak you.

    I also bought a used iPhone5 from the market here in Pakistan. The original user hasnt removed the device from his/her iCloud. I had to restore my phone because of some problem and now im stuck at the activation lock. I dont know the iCloud ID of the original user(that could be helpful in order to contact the user) and obviously I dont know the password aswell. So now my $855 worth device is useless. Ive been waiting for three months for some solution but all in vain. APPLE!!! PLEASE help me out here.

  • Someone has Stolen my iPod touch and they turned off Location Services I used iCloud To Lock it Please Help

    Someone has Stolen my iPod touch and they turned off Location Services I used iCloud To Lock it Please Help

    How can we help?
    If they turned it off, you are hosed.
    Allan

  • ITunes locked? please help! :(

    when i go to open my iTunes it comes up with this error message!
    The iTunes Music Library.itl file is locked, on a locked disk, or you do not have the write permission for this file.
    Please help me, i sent my iPod nano away for it to be repaired and in that time got a new computer, i couldnt find my CD when i got my iPod back so i downloaded it from the internet, and it kept coming up with this message after i installed it, it worked once but then stopped and now i found the CD, i installed that and it still doesnt work PLease help me i realli need this fixed
    Thanks xx

    Thank you Thank you! i didnt think i would have got it to work, i just searched my computer to find my iTunes library, right clicked for properties and it was "read Only" thanks so much

  • Locked iPOD , Please help!

    Bieng dumb as Iam, I decided to put a password on my ipod Nano and lock it so no one else in the family can use it. But i forgot my password! what can I do please help.
    E773C   Windows XP  
    E773C   Windows XP  

    Iv already tryed that, its charging and it says do
    not disconnect.
    ok now eject it and it will be unlocked
    iPods- 4gb Balck Nano, 60gb Black 5g}{Black Moto Razr}{PSP}{iPod Radio Remote   Windows XP   <img src="http://i36.photobucket.com/albums/e13/superman5656/sm.jpg"align="right

  • After 3.0 firmware my Sim Locked? Please help me!!!!

    My iPhone 3G after 3.0 firmware Sim Locked. I dont understand I bought this 3G original Phone Company(Turkcell) with 18 months contract. Why is that happend? Please help me? Can I downgrade?
    Message was edited by: mapel

    Ok. I called Turkcell and problem solved.
    Solution: You must USB plug connect 2 times with iPhone. So easy progress

  • HT1937 I cannot use my IPad; it tells me my SIM is locked.  Please help

    I cannot use my IPAD; it says that the SIM is locked.
    Please help

    Enter the SIM unlock code.
    Remove the SIM, it's not required for the iPad to work.
    Replace the SIM with one that does not have a lock code on it.

  • I bought a usb microphone (blue snowball). I can't hear any sound from it. The MIDI master volume is turned all the way down, and I can't turn it up because it's frozen/locked. Please help!!! Not very tech savvy, been at this for hours and desperate :(

    I've been trying to fix this problem, seems like it would be simple, but apparently it is not. I just want to turn up the master volume control under my input tab in MIDI audio devices so I can use my blueball microphone.
    This image above is what I'm currently dealing with. I put a red box around the volume control I want to use. That is the one I can't turn up because it is locked/frozen.
    Please make steps as simple as possible!
    Thanks

    You should have gotten a user manual.  If the manual is of no help, contact the manufacturer. 

  • Is there a way to back up a locked ipod PLEASE HELP ME !! :'(

    so i cracked the screen to my ipod it is incredibly bad so bad the screen dosen't even work as in i can't put my password in and actually use my ipod therefore i can not backup my ipod to my computer (mac) because it asks me to put in my password which i can't do is there a way to back up a locked ipod touch 5th generation PLEASE i really do not want to lose my pictures if anyone can help me

    Your only option is a data recovery company. Not cheap.

  • Disable IPhone with forgot the lock code please help!!!!!

    my IPhone is disable but I forgot my lock code so when i'm connect to ITunes it say cannot use ITunes because the lock code but my phone is disable so please someone help me!!!!!!

    Well, let's assume for the moment that my first thought that the phone is stolen is wrong, although your random user ID would tend to imply that. It depends on which passcode is lost. If it is the SIM key you will have to get a new SIM card from your carrier (you didn't say which country you are in, so I can't tell you who your carrier is). If it is the phone's passcode lock you will need to do a forced restore, which will wipe all content from the phone. If it's your phone this shouldn't be a problem, because it is all backed up in iTunes and will be reloaded after the restore. Of course, you will still need the passcode, so that may not be possible anyway.
    To do a forced restore hold the HOME button, then connect to the USB cable AND CONTINUE HOLDING for a LONG time (a minute or more). Once iTunes responds release the button and your phone will be restored.

Maybe you are looking for

  • How to access defined connection in my project

    I am new to JDeveloper, I created a "Connection1" through Connection Wizard and store it under the Connections node in the System Navigator. I also tested it, it works fine itself. According to online helper "All defined connections to external data

  • Section code issue

    Hi, i have last year advance payments at that time withholding tax is not activated. this year i want to clear those advance payments aganist vendor invoices . while doing that i got error "section code is mandatory for line itm" Section code is mand

  • Where to find BPS error log

    Hi Experts, I try to open a BPS planning level and I receive the following error. UPC_FW030 with the hint to analyse the error log. There must be something wrong with the selection but the system automatically removes parts of the section. Can anyone

  • Enkitec Modal LOV window too narrow - 'next page' button missing

    Hi, Apex 4.2, any theme, any browser. Does anyone know how to set the minimum width for the popup window for this otherwise excellent plugin. The problem occurs when the width of the data in the search results is narrower than the search bar at the t

  • Yosemite OS is consuming too much internet data in the background

    Yosemite OS is consuming too much internet data in the background for no apparent reason. It's draining my monthly internet quota. It's important to note that iCloud Drive and photo stream are disabled. Anyone knows how to sove this problem? Otherwis