How to implement Reentrant Read Write Locking??

It seems like there should be a ReentrantReadWriteLock in Coherence. Am I missing some basic concept or something?
Thanks!

Hi,
there is no such thing as a shared lock on cache keys in Coherence out-of-the-box, at the moment, but it can be implemented on top of other features (with some performance decrease), but it is a fairly complex task, particularly the continuation of the client thread once the lock is acquired is tricky. Also that approach wouldn't be integrated with Coherence TransactionMap and JCA Adapter features, so in case you need such things you would need to reimplement those on top-of the custom read/write locking solution on your own.
Best regards,
Robert

Similar Messages

  • How do you implement 'Dirty Read/ Write' concept?

    Hi,
    I need to implement dirty read/ write concept into my procedure. I wanted to know how to go about it. Does Oracle have provide a way to do this or is this something to be worked out with some logic manually?
    Can someone suggest the exact logic I should follow or chalk out a simple algorithm.
    Any kind of information on this would be much appreciated.
    Thanks,
    Amrita.

    Sorry for this late reply.<br>
    My first reply should have contained an example on how to implement it for the kicks. Don't use this code for anything else but a test. It's absolutely worthless application-wise. But it proves that some dirty read/write functionality can be obtained if one twists everything that is good. Here goes. First I create two java classes and two PL/SQL "wrappers". Then - simply connect with session 1 and invoke exec dirty_write<br>
    make no commit ... and let session 2 select dirty_read from dual. You'll notice that the data written by session 1 is read by session 2.<br>
    create or replace and compile
    java source named "FileAppendTest"
    as
    import java.io.File;
    import java.io.FileOutputStream;
    public class FileAppendTest {
    static public void append() {
      try {
        int vSomethingToWrite = 9;
       File vFile = new File("c:\\db_out.txt");
       FileOutputStream vAppendFile = new FileOutputStream(vFile, true);
       vAppendFile.write ( vSomethingToWrite );
      vAppendFile.close();
      } catch (Exception e) {
       // let this test hide all errors
    create or replace and compile
    java source named "DirtyReadTest"
    as
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    public class DirtyReadTest {
    static public int read() {
      int vError = 0;
      try {
       File vFile = new File("c:\\db_out.txt");
       FileInputStream vReadFile = new FileInputStream(vFile);
       return vReadFile.read();
      } catch (Exception e) {
       return vError;
    create or replace procedure dirty_write as
    language java
    name 'FileAppendTest.append()';
    create or replace function dirty_read return number as
    language java
    name 'DirtyReadTest.read() return integer';
    -- as I mentioned earlier. Only try this code for the fun of it. Don't consider it for anything remotely usable in an application.

  • Q. Reader-Writer lock across unrelated processes?

    What mechanism would you suggest to implement Reader-Writer locks across unrelated processes?
    Though the documentation for pthread_rwlock_ functions state
    Synchronization Across Process Boundaries
    Each of the synchronization primitives can be set up to be used across process
    boundaries. This is done quite simply by ensuring that the synchronization variable is
    located in a shared memory segment and by calling the appropriate init() routine,
    after the primitive has been initialized with its shared attribute set as interprocess.
    but they work only if the processes are forked off from a given process which initialized the relevant synchronization variable and not if the processes are totally unrelated.

    What mechanism would you suggest to implement Reader-Writer locks across unrelated processes?
    Though the documentation for pthread_rwlock_ functions state
    Synchronization Across Process Boundaries
    Each of the synchronization primitives can be set up to be used across process
    boundaries. This is done quite simply by ensuring that the synchronization variable is
    located in a shared memory segment and by calling the appropriate init() routine,
    after the primitive has been initialized with its shared attribute set as interprocess.
    but they work only if the processes are forked off from a given process which initialized the relevant synchronization variable and not if the processes are totally unrelated.

  • How do i change read/write permission on an external hard drive?

    how do i change read/write permissions for an external hard drive?

    If, on the otherhand, you are trying to write to a drive that is formatted NTFS (for Windows), and can't.
    You have two choices...
    1. Reformat the drive. Either Mac OS format, if you are using this only on your Mac. Or ExFAT, or FAT 32 if you intend to use it on both a Mac OS computer and a Windows unit. note: ExFAT is not suported by XP.
    2. Install one of the drivers necessary for the Mac to write to a NTFS volume. Unless you want the experience of having the support for this being one that is sporadic, avoid this. I used to be a strong proponent of NTFS-3G, until I started having the problems with Lion, that many users warned us about. Go this route only if you find you must use NTFS on your drive. Paragon and Tuxtera are the sources for these.

  • Robust Reader Writer Locks?

    Does anyone know of an implmentation of robust reader/writer locks? (i.e. locks that unblock and return an error when the process that holds the lock dies) I found that Solaris supports robust mutex locks, but cannot find anything about robust reader/writer locks.
    Thanks for the help!
    Jason

    It doesn't sound like you have a good background in concurrency yet. Take a look at this book.
    http://java.sun.com/docs/books/cp/
    Great book, great guy. Let me know if you need any help after you start.

  • Could not obtain a maintenance-read + write-Lock for DBQueue/QStream/jobID

    Hi All,
    Does anyone know what does this error mean?
    com.sap.b1i.xcellerator.XcelleratorException:
    XCE001 Nested exception: com.sap.b1i.xcellerator.RejectedException:
    XCE061 Could not obtain a maintenance-read + write-Lock for DBQueue/QStream/jobID Q.INB_IQ_INTQ_ASYN_QS.0010000000
    Regards
    Szymon

    You see that's the thing, I'm not using it for a picture camera. The camera prob wouldnt read the card anyway. I'm using it as a storage device for my Nintendo Wii, I have files that I put on there to use as channels for my Wii Home Screen.

  • How can I change read/write permissions for a DVD RW?

    I've some files saved onto a DVD RW previously and would like to add on more files to it.  However, it doesn't allow me to do that.  When I checked the file info, it says that I have read & write privilege, but at the same time, there's another line that says "You can only read".  When I clicked on the lock to attempt to make changes to settings, nothing is clickable.  Take a look at the screenshot below and you'll know what I mean.
    Can anyone advise on why this is happening?

    A DVD-RW has to be wiped before re-use, so you will lose all data previously copied to it.

  • How can I disable read/write restriction from directory, disk is not full ?

    Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features.

    See:
    *https://support.mozilla.com/kb/Could+not+initialize+the+browser+security+component

  • How can I control Read/Write for BegBalance under the same Scenario in different Years?

    As we know, we can set 'Start Year/Period' and 'End Year/Period' on a scenario member, e.g. Budget, to control whether planners can input data under this scenario.
    However, we can only choose years and month from Jan to Dec. BegBalance can't be chosen.
    Assuming a form putting Year dimension as a page, Scenario and BegBalance, Jan to Dec as column, Account as row.
    If planner chooses budget year in the page, every column from BegBalance to Dec is writable.
    The problem is, when planner chooses current year in the page, Jan to Dec is read-only, but BegBalance is still writable.
    This will make the planner confusion and put the data in a dangerous position.
    Is there any idea to avoid this situation?
    Thanks.

    You can disable (write) BegBalance for that Scenario by unchecking "Include BegBalance".
    Regards
    Celvin
    http://www.orahyplabs.com

  • How do I restore Read & Write privileges to a hard drive?

    I made an error to change it to No Access for the administrator. Now the hard disks are no more on the desktop, and in Disk utility they show as non-selectable documents. How can I restore this? Please don't tell me I've lost my drive!

    What happens if you boot from your install DVD and repair your permissions? You could login as 'root' and reset permissions that way.
    -Bmer
    Mac Owners Support Group - Join us @ MacOSG.com
      Mac611 Mobile Mac Support - about.Mac611.com
       iTunes:MacOSG Podcast | YouTube.MacOSG.com
                       An Apple User Group 
    Have an iPhone or iPod touch? Enter Mac611.com in Safari on it for 'mobile Mac support.'

  • FileStream locks read & write access. How can I get around this?

    I'm progressively downloading a video from a server using URLStream and FileStream classes to download and save the data to disk. While this is happening, I would also like to begin playback of the video so the user can progressively watch while this is happening. The player uses a standard FLVPlayback (version 2.5) control to load and playback videos. Unfortuantely, FileStream creates a read & write lock on the file and nobody has thus no one else can have access to it. This is a little bezarre to me because a read lock on a download is counter-intuitive, especailly for my application. I looked around the API docs but I could not find an option where I can manually set the locking mechanism on a file. Is this at all possible in Adobe AIR?

    nef9877 wrote:
    If I deathorise aall comuters and then re-authorise only the ones I want to use would this do it?
    Yes, that's how it's done.
    Read the warning about the number of times you can do this each twelve months. It can only be done so many times per year (I forget the exact wording).

  • Macbook Pro 1.1 how to improve read/write speed

    Hello,
    I am looking to improve the read/write performance of a 2006 2.16 Intel Core Duo Macbook Pro with 2gb RAM (the max), that I use on a specific job in a specific workflow.
    In the workflow there are three retouchers using three different MBPs and transferring files via Ethernet network to a fourth MBP (the one in question) which is used as a dropbox, if you like.
    So the MBP in question has no applications running. Files are saved to it and opened from it and saved back to it.
    How can I improve read/write speed on this MBP under these conditions?
    Would installing an SSD be the answer? Or is it really a processor issue and there's nothing to be done? I figure RAM doesn't really come into it, but in any case 2GB is the max this model can accept.
    Many thanks in advance.

    An SSD would definitely improve read/write speed. However, depending on capacity needed, are you sure you want to sink the money into this machine? Start here:
    http://eshop.macsales.com/shop/hard-drives/2.5-Notebook/

  • Reader writer thread

    I don't know how to start to implement a reader writer thread. I have a vector, and multiple threads. I would like to allow mulitple threads to read and one to modify. Does anyone where I should start? I know that I can't use
    synchronize(object) {
    since this will only allow one thread to acess the code.
    Thanks.

    It doesn't sound like you have a good background in concurrency yet. Take a look at this book.
    http://java.sun.com/docs/books/cp/
    Great book, great guy. Let me know if you need any help after you start.

  • Java card and reader/writer prices

    hi...I would like to know how much is a java card and how much is a reader/writer? thanks.

    You should implement your own session handling mechanism since the only type of session that is supported by JavaCard is HTTP, in version JC v3 (Connected version).
    Actually, I'm not even sure an HTTP session would suit your requirements.
    The easiest way to implement a session flag in your proposed system would be via a timestamp (saved in the Java Card applet).
    What does the following line mean?
    DOEACC@VIVS wrote:
    www.omnikey.com is best place

  • Error 33172 occurred at Read & Write data transfer between two or more PF2010 controller

    Hi,i need to do data transfer between two or more FP2010 controller.e.g. FP2010(A) & FP2010(B).
    FP2010(A) need to transfer the measurement (from its I/O module) to FP2010(B) to do the data analysis.These data transfer should be synchronous btw two controller to prevent data lost.
    From the vi used in the attachment,i encountered some problems at:
    (1) Error 33172 occurred while publishing the data.Can i create and publish data under different item name?
    (2) How to synchronies the read & write btw contorller?
    All controller are communicating with each other directly without the need of a host computer to link them together
    Is there any other method to do fast data transfer betwe
    en controller?

    Hi YongNei,
    You were succesful in omiting enough information to make it very difficult to answer!
    Please post your example.
    Please tell us what version of LV-RT you are using.
    Please define what you concider "fast data transfer".
    Have you concidered mapping the FP tags of FP2010(A) to FP2010(B) and vise versa?
    WHat exactly has to be syncronized?
    If you have something that is close to working, share that.
    Well, that as far as I can go with the info you have provided. Depending on the details, what you are asking could be anything from trivial to impossible with the currently available technology. I just can't say.
    It would probably be a good idea to start over with a fresh question (sorry) because not many people are going to know what a a "
    PF2010" is and I can not guarentee that I will be able to get back to you personally until next week-end.
    Trying to help you get an answer,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for