Locking mechanism

Hi,
i understand locking mechanism used in situations where two users are updating the same object same time to maintain concurrency.
but..in actual ..in operating system view..we can see an object can be processed by only one user.if another user is updating the same object at the same time,the process will go in a queue and processed one at a time..my question is Why locking s used..???a million dollar question for me!!!pls help
thanks

Hi,
it is object inside the objects,i guess os treats oracle database server as an object,and let oracle handle the things inside oracle which is actually running inside oracle.this is the way os works for their applications.
thanks.

Similar Messages

  • Locking mechanism provided by the Web AS Java

    Hi All,
    I have a requirement to lock an object for a specific action
    with using locks provided and managed by the Web AS Java (i have to use TableLocking API).
    I have read about the locking mechanism in "SAP NetWeaver Developer Studio Documentation help" .
    I need code samples (how it can be done).
    How i should check data availability (is it locked?)?
    Thanks.

    hi
    new features added in WAS7.0 for ABAP stack
    1.Webdynpro for ABAP
    2.New Enhancement Framework
    3.Switch Frame Work
    4.Adobe Forms integeration
    5.New features added to ABAP Editor.
    Also note that MySAP Business Suite is also the part of WAS7.0 release.
    For Java stack new features have been added to Netweaver Developer Studio,EP and KM areas.Also BI-Java is also the part of WAS7.0 Release.
    Cheers,
    Abdul Hakim
    Mark all useful answers..

  • How to implementing locking mechanism in abap?

    Hi
         my program run by different users. I want
         to ensure that at a particular point of time only
         one instance of my program running, and all others
         should be in wait.
         if have a solution for this. i can make use of a flag
         (global flag ) i set/get this flag from import/export
         mechanism. for example.
         do.
         import v_flag = v_flag from MEMORY id 'ZFLAG'.
         if v_flag is initial.
             v_flag = '1'.
             export v_flag to memory id 'ZFLAG'.
             exit.
         endif.  
         enddo.
         ***Rest of the program main code****
         clear v_flag.
         export v_flag to memory id 'ZFLAG'.
         is this ok? or any other locking mechanism supported
         by abap.
    Regards,
    Abhimanyu.L

    Hi
    Check the following,
    http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/aa/fd823730fa874ae10000009b38f8cf/content.htm
    http://www.sapdb.org/7.4/htmhelp/7d/75d34a6a210b4b95f232e5f9acd232/content.htm
    http://www.sapdb.org/7.4/htmhelp/6e/ab5d79286b3d4a9f72ef140191d208/content.htm
    http://sapdb.net/7.4/htmhelp/43/151d12671a2240947990c5152a4bbd/content.htm
    Please reward if it helps.

  • How to impement Webi Report locking mechanism

    Hi ,
    Can you please suggest me how to implement Webi Report Locing Mechanism .
    Thanks & Regards
    Venkat

    Hi ,
    Thanks for your reply .
    we have comments column in our report .  for each we have added one blank cell to give the comments purpose .
    But Multiple Users are trying to edit the report same time  so who ever saved the report those comments only available .
    To avoid multiple users to edit the same report we want to implement the report locking mechanism similar to Universe Locking mechanism in Designer .
    appreciate your speedy response .
    Thanks & Regards,
    Venkat

  • Pessimistic Locking mechanism in SAP Gateway.

    Hi All,
               I am new to SAP Gateway. I know there are two types of locking mechanism ( optimistic and pessimistic) . Optimistic we do by etag and if-match.
    Is there any idea of how to do by pessimistic approach.
    For example we are reading a contract and then updating it. So, in get_entity we have to put the lock while reading and we have to unlock while updating. But how does it works. Whether the lock automatically get released after the get_entity method.
    Kindly guide me in proceeding further.

    Hi Sundar,
    Here is my opinion :
              Gateway is Completely Stateless till the current version which is SP8. So Pessimistic Locking would not be available out of the box by Gateway. You need to implement your custom logic to achieve this behaviour. However simulating a Pessimistic Lock in a complete stateless architecture will lead to many complexities which often might lead to inconsistency in the Application.  As mentioned by Krishna, you can store lock information in some table in backend , but it might get messy very easily. I would not recommend to do so. However if you are really keen to do Pessimistic Locking kind of mechanism, what about the following approach -----
    1. In the OData service, let us have an extra Entity  called LOCK which has properties such as USER, RESOURCE_ID(such as contract ID),DATE,TIME. USER and RESOURCE_ID is the key in this entity. This data is stored in a table in database.
    2. When a particular USER  opens the CONTRACT screen in EDIT mode, the UI fires a POST(Create) call for Entity LOCK with the USER and RESOURCE_ID(contract ID in this case). In the backend database table if no entry exists with that USER ID and RESOURCE_ID, then a new entry is created and the USER is allowed to EDIT the contract. If an entry already exist in table then it means some other user is already in Edit mode , and the current user is refused to access the resource in edit mode.
    3. When the USER saves the CONTRACT you need to fire a DELETE request for that Particular LOCK entity. Thus is resource is dequeued.
    However this is like a vanilla flow. Handling can be complicated if user closes the browser, disconnects the network connection, opens parallel session etc etc.
              Rather a clean approach would be an Optimistic lock. Fiori Applications are using this mechanism to handle concurrency control. You may refer to my reply on Locking mechanism in SAP Gateway. for a little more information on Optimistic Locking.
    I agree that even though Optimistic locking works pretty well in REST based applications as it allows operations to be free from overhead of long transaction , there can be situations as mentioned below, where an Optimistic lock might not be preferred -
    1. Where the chances of concurrency collision is very high (Example: Online Reservation of Tickets)
    2. If modifying the resource by the user requires a lot of typing (However JS libraries such as Garlic.js, sisyphus.js or HTML5 Local storage can help us here )
    Now it is upto you to decide upon the approach ..

  • Locking Mechanism/Isolation Level with Datastore (Pessimistic) Tr ansactions

    What type of locking is Kodo JDO performing in datastore (pessimistic)
    transaction mode? Is a TRANSACTION_SERIALIZABLE isolation level being
    specified when the connection is obtained or is SELECT FOR UPDATE being
    used?
    Does the locking mechanism differ across database platforms? I had read
    that only shared locks would be used on Microsoft SQL Server.
    Also, what is the JDOLOCKX column generated by the schematool used for?
    Does it contain a counter or timestamp used during optimistic transactions?
    Thanks,
    Sasha Haghani.

    What type of locking is Kodo JDO performing in datastore (pessimistic)
    transaction mode? Is a TRANSACTION_SERIALIZABLE isolation level being
    specified when the connection is obtained or is SELECT FOR UPDATE being
    used?Kodo sticks with the default isolation level of the JDBC driver in use
    for transactions, as we've found that many drivers act up when assigned
    a level manually.
    To lock records during pessimistic transactions, SELECT FOR UPDATE is
    used. For the most part, it gives good object-level locking, preventing
    concurrent modification, even in applications that span multiple JVMs.
    Does the locking mechanism differ across database platforms?The locking differs across databases only in that some DBs do not
    support SELECT FOR UPDATE (in which case it is still possible to get
    optimistic lock exceptions during pessimistic transactions), some DBs
    use a different mechanism (SQLServer has a shared lock construct that is
    just as good if not better), and some DBs place restrictions on its use
    (Oracle and PostgreSQL cannot lock rows when a SELECT DISTINCT is used).
    See the 'known bugs and limitations' appendix of the Kodo user guide for
    a detailed listing of locking issues with each databse.
    Also, what is the JDOLOCKX column generated by the schematool used for?
    Does it contain a counter or timestamp used during optimistic
    transactions?The lock column contains a counter to keep track of object versions. As
    you suspect, it is used so that during optimistic transactions when no
    locking is performed (or during pessimistic transactions on DBs or
    queries that can't perform locking), the system is able to detect that
    concurrent modification of an object has occurred and throw the proper
    exception. This way data integrity is never lost, even without locking.
    As an aside, you can always view the SQL generated by Kodo (and by
    looking at it get a feel for how the various table columns are used,
    etc) by setting a print writer in the
    JDBCPersistenceManagerFactory.setLogWriter() method. Kodo will echo all
    SQL to the given stream.
    Happy coding.
    -- Abe White
    TechTrader

  • Fault tolerance of Distributed Locking Mechanism ?

    Is there a lock server for managing locks
         in a Coherence distributed cluster ?
         How fault tolerant is the locking mechanism ?
         What happens if a node which has acquired a lock dies ?
         If there is a lock server, what happens if the lock
         server dies ?
         Is there an upper limit on the number of nodes that
         a Coherence distributed cluster supporting distributed
         locking can have ? And how long does it take for
         the cluster to re-organize itself after a node has gone
         down ?
         Thanks!

    A central lock server does not address any of the issues that you raise, and it also adds a single point of failure (SPOF) into the environment.
         The "link breaks" problem is known as the "split brain" scenario. There is no single correct answer for the split brain, and there cannot be (by principle) a single correct answer for it.
         Our plans for managing split brains involve the ability to define one site as a primary and one as a backup. If the primary becomes disconnected from the backup, it doesn't know if the backup is "down" or just disconnected, but it doesn't matter, because the primary is the primary so it needs to keep going.
         On the other hand, if the backup becomes disconnected from the primary, it may not know whether the primary went down or not, but it may be able to use a third party to find out. Consider points P, B, O1, and O2 where P is primary, B is backup, O1 is some other location and O2 is some other location. If B can reach O1 and O2, it knows that it still has connectivity. If B asks O1 and O2 if they can reach P, and neither can reach P, then it indicates that the problem is on P's side. Now the question is whether B should take over processing, which could be automatic, or it could be configured to be a manual switchover process.
         In either case, the answer could theoretically be incorrect, and like all unsolvable (literally unsolvable, not just unsolved) problems, you simply must choose which risks to mitigate, and how much expense you are willing to apply in order to reduce those risks.
         For example, Coherence 3.0 will allow you to run redundant networking across those sites, so losing a connection between two sites might actually require a minimum of three networks to fail completely. What's the cost of running three independent WANs over physically separated fiber? Especially if it is your own private cabling and networking and it's a 50km distance? It's pretty expensive, but that's how some financial services firms set up their DR sites.
         Like I said, there are no perfect answers, and there cannot be, but we provide the means for you to select from a variety of risk-mitigating solutions that in total can reduce the likelihood of any of these problems actually occurring into an infinitesimally small probability domain.
         Peace,
         Cameron Purdy
         Tangosol, Inc.

  • Locking Mechanism -----Performance Indicator

    hi all,
    in the locking mechanism , we use the derived enqueue and dequeue function modules .
      the use of parameter  collect = 'X'  in the dequeue function module is a performance indicator that was solving my problem .
    i just want to know still is there anything more i can make use of it if im using it in synchronous and asynchronous mode.just mail me if u want to know the scenario im using it.
    regards,
    vijay.

    Hi,
    it is object inside the objects,i guess os treats oracle database server as an object,and let oracle handle the things inside oracle which is actually running inside oracle.this is the way os works for their applications.
    thanks.

  • File locking mechanism

    Hi,
    I have a single file that many clients will be able to update. How do I prevent that two clients update at the same time, and there by the first update will get lost? I think I need some kind of locking mechanism. No server is available, so the clients have to handle this themselves.

    I just noticed, it might get a bit confusing using the
    word "file" for both the lock and the file being locked.
    So I have the same post again, but this time using
    "master" for the file that is actually the one to change:
    If the the master is locked, the lock file exists. If the
    lock file does not exist, the master ist not locked.
    Client1 attempts to create the lock file. If that fails,
    because the lock file already exists, then there already
    is a lock and Client1 has to wait. If creating the lock
    file works, Client1 may do whatever it deems necessary
    to the master. Afterwards, the lock file is deleted
    by Client1 to indicate the master is now unlocked.
    Jens

  • Please suggest me good links for locking mechanism in SAP

    Please suggest me good links for locking mechanism in SAP
    thanks,

    Hi Akash,
    Here is a small description on lock object.
    The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the lock table of the system for each table.
    Access by more than one user can be synchronized in the following ways:
    Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.
    Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.
    Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.
    Check out this thread:
    LOCK OBJECT?
    Regards,
    Vivek
    PS: Award points if helpful

  • Ink cartridge lock mechanism

    I also posted this question here http://h30499.www3.hp.com/t5/Printers-Deskjet/HP-Envy-4550/m-p/6474126#.U3NuzU2UOos but have not recviced a response, so hopefully I will here.
    I have a HP envy 4500 all in one and I need to know how to put the ink cartridge lock mechanism back on where it needs to go, you can see in the pictures what I am talking about.
    This question was solved.
    View Solution.

    Hi, thanks for the photo. If the printer is still under warranty I would call Support. If not I would try taping it back into place. It's just a little clip that makes sure the cartridge is held in place.
    Although I am an HP employee, I am speaking for myself and not for HP.
    Twitter: @Ciara_B_HP

  • Locking mechanism while import transports with table conversions

    Hi all,
    quite often, we have the request to import to our PROD FI SAP System a big list of transports which are performing also table conversions (addition of columns, removeal of columns etc).
    During the import of the transports we inform the people not to logon on the system and perform any kind of job.
    However not everyone is respecting the notification.
    Is there any mechanism to prevent all the users from logging onto the SAP system?
    Kind Regards,
    Loukas Rougkalas

    Hi Loukas,
    call SE16, table name = USR02, (get variant that listed only the users they are not in user groups SYSTEM, SUPER, BASIS Admin and so on), F8, Export the list of users to Excel, StrgShiftF7 - is only working in ALV Grid display (Settings - User Parameters - ALV Grid display)
    Then lock the users with transaction SU10 - Authorization data - mutiple selsction - copy the list of users from clipboard (excel Table "B") and paste it into "single value" (ShiftF12 -> F8 -> F8) - Select all (F5) - click to "Transfer" then you can lock the users with CtrlF5
    To unlock the Users repeat step 2 - instead of StrgF5 click StrgF4 for unlock
    Gerd
    Edited by: Gerd Schuster on Nov 17, 2009 2:12 PM

  • Submitting job in background with lock mechanism

    Hi,
    I'm obtaining a lock before submitting the job and releasing it after submitting...as explained below
    I want to know whether the lock will get released immediately after submitting the job or it will be released only after the finish of the job. Can you explain with any documentation if possible...
    CALL FUNCTION 'ENQUEUE_EXXXX'
    SUBMIT rvv50r10c   USING SELECTION-SET w_variant
                           TO SAP-SPOOL
                           SPOOL PARAMETERS print_parameters
                           WITHOUT SPOOL DYNPRO
                           VIA JOB name NUMBER number
                          AND RETURN.
    CALL FUNCTION 'DEQUEUE_EXXXX'

    Hi,
    If you are locking any database table object then the lock will be removed only after the call function 'DEQUEUE_EXXXXX".
    Regards,
    Shahu

  • Locking Mechanism in Webdyn Pro Abap

    Hi Experts,
    In our scenario, we are sharing one person approval records to other users. The approver overview screen is of FPM GAF. Here we are getting the problem as both the approvers are able to access the same records at same time. Can we restrict the apporver before accessing the record when it is already in process(any kind of locks will be available)? Any suggestions on how to do?

    Hi Reyaz
    If you are going with Custom then create a lock object for your custom table, and provide the primary table details as Name: Table name & Lock mode: write lock (Exclusive lock mode). This will allow only one user to manipulate the data and block the rest of the users.
    Cheers
    Pradyp

  • Hi , I changed my router 2 weeks ago but with same ISP Plusnetw the Mac defaults to BT Openzone everytime I aces the internet.I have to go to internet connections and choose plus net every time Closing the lock mechanism does not stop it happening next

    Hi I changed router 2 weeks ago still with PlusNet.My desktop Mac OS 10.8 defalts to BTWiFi hotspot login page every time I try to acess the internet.I have to go to the internet and manually choose PlusNet.I lock the page but the same thing happens the next time .There are 4 computers in the house and this is the only one doing this.What do I do
    thank you
    Geraldine HW

    Hi,
    interesting story. Did you find a way to configure phone for Internet calls (VOIP)? Using Setup/Connection/Admin Setup/SIP Setup (I am not sure about names as I am using Polish version) I may configure SIP profile and even register it ... but that is all. No way to make Internet calls even manual is saying about way of making them
    regards, 

Maybe you are looking for