Locking a datablock

Hi guys, my scenario is that i have a datblock based on a table but when i make changes i dont want to lock the table that the datablock is from, i actually want to lock a different table within the database as I am actually updating a different table than the datablock. I assume i would use some sort of code in the on-lock trigger but am unsure which code to use. Could anyone please point me in the right direction.

Sorry if im not making myself clear, and thanks for the responses, I really do appreciate the help.
I have to lock the row being edited in the other table basically. So on my on-lock trigger i basically done a select into statement with a FOR UPDATE on the table/row I want to be locked. However, for some reason it still says my table is still not in sql scope.
Weird, r perhaps im doing something silly lol
     SELECT :model INTO v_model
          FROM models mo
          WHERE mo.ID = :mo.mo_ID
          FOR UPDATE OF models nowait;
Thanks again for the help. And sorry if I am not describing the situation well.

Similar Messages

  • Error updating a datablock that uses a view

    I have a view that is using a UNION ALL between two tables. I have written the instead of trigger properly and I have no problem updating, inserting or deleting thru the view in Oracle.
    The problem is that forms will query the view fine, but will not allow me to update any field associated with the datablock. I'm getting the following error message:
    "FRM-40501: ORACLE error: unable to reserve record for update or delete"
    and when I do display error, I get the following message:
    "ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc."
    Any help would be appreciated, thanks in advance!

    Well I only did the instead of trigger thing once.. But Ill stick my neck out anyway...
    Since you have instead of triggers you may be able to get away with just putting a "null;" in the on-lock trigger or write your own locking code in the on-lock trigger. Search for locking in this forum for examples.
    I think using the instead of triggers may override the need to specifically put insert, update, and delete statements in on-update, on-delete, on-insert form triggers.
    Basically with instead of triggers the form will try to do its normal processing and issue select, insert, update, and delete statements on the view, which usually causes headaches, but the instead of triggers on the view will take over do the DML upon other appropriate tables making everybody happy. I think the locking is your issue.
    Now if you werent using instead of triggers you would have to put update, insert, delete statements in the on-insert, on-update, on-delete triggers.
    I think.. :)

  • To connect a datablock to a query - stored procedure: problem

    I have the following table...
    CREATE TABLE I_TIPOLOGIA (
    CODICE NUMBER(6),
    DESCRIZIONE VARCHAR2(100),
    CONSTRAINT I_TIPOLOGIA_PK PRIMARY KEY (CODICE) );
    and the following package to connect a datablock to
    previous table with a stored procedure...
    CREATE or REPLACE PACKAGE DATABANKER_TIPOLOGIE AS
    TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE;
    PROCEDURE leggi(resultset IN OUT TipTableOfRec);
    END DATABANKER_TIPOLOGIE;
    CREATE or REPLACE PACKAGE BODY DATABANKER_TIPOLOGIE AS
    PROCEDURE leggi(resultset IN OUT TipTableOfRec) AS
    BEGIN
    SELECT * BULK COLLECT INTO resultset
    FROM I_TIPOLOGIA;
    END leggi;
    END DATABANKER_TIPOLOGIE;
    When I compile the form I receive in QUERY-PROCEDURE trigger
    en error 306: "number or type of arguments are wrong in POPULATE_BLOCK"
    I post the trigger auto generated by Forms Builder 6i...
    DECLARE
    bk_data DATABANKER_TIPOLOGIE.TIPTABLEOFREC;
    BEGIN
    DATABANKER_TIPOLOGIE.leggi3(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'BLOCCO50'); -- <- error here
    END;
    How can I solve this problem? Maybe there is a bug?
    P.S. I'm using Oracle Database 9i

    CREATE or REPLACE PACKAGE DATABANKER_TIPOLOGIE AS
    TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE;
    PROCEDURE leggi(resultset IN OUT TipTableOfRec);
    END DATABANKER_TIPOLOGIE;I have solved with this replacement 1) -> 2)
    1) TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE;
    2) TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE
    INDEX BY BINARY_INTEGER;
    with 2) now works.
    Now I have stored-procedures for query, insert, delete
    and update.
    I have some problems with delete and update of the records
    because it seems that they are locked.
    I think that it is due to the absence of lock
    stored-procedure... there's someone that can help me with
    the lock SP implementation?

  • Foreign Key Locking Record

    In Form6i
    Master Table Party (Party.fmx)
    PartyCode,
    Partyname
    Transaction Table ( trans.fmx)
    TNo,
    TDate,
    PartyCode,
    Amount
    one user is editing record in party
    can other user insert or edit record in transaction form ?

    Not sure this is the issue you are experiencing but here is my guess:
    In Forms default behvior is to build an update statment for all db columns in the datablock, regardless of whether user changed those columns or not. So in your sample if the user updates the Amount column you might expect the update to be along the lines of the following pseudo code:
    update transaction_table
    set Amount = bind variable for amount field
    where rownum = bind variable for current record
    However, what it actually does is:
    update transaction_table
    set TNo = bind variable for TNo field,
    TDate = bind variable for TDate field,
    PartyCode = bind variable for PartyCode field,
    Amount = bind variable for amount field
    where rownum = bind variable for current record
    So even though these fields were NOT changed they are included in the Forms update statement and the fact that you are updating the foreign key, PartyCode, column causes the db to get a lock on the Master Party table to validate the foreign key relationship. The way around this behaviour is the "Update Changed Columns Only" property at the block level in your form; if you set this property to "Yes" then it should prevent the update statement from including columns that the user did not change in the form.
    The gotcha here is db trigger processing and keeping form data in synch with anything a trigger changed, I have seen some strange issues with triggers when doing this so if there are triggers on your transaction_table make sure they still behave as expected.
    Again, not sure if this is what you are experiencing; hope it helps.
    Wendell

  • Inconsistent Locking with Select for Update

    Hi,
    I seem to be having some issues in using SELECT FOR UPDATE and was hoping to get some insight from the Oralce Guru's out there.
    I have a J2EE application, running in WebLogic 8.1.4 using Oralce 9.2.0.1.0.
    The application contains code that requires locking to be done on a specific table with multiple transactions (tx) requesting the same lock. Eg:
    Tx 1: Select * from Zone where Zoneid = 'Zone1' for update (Obtains lock)
    Tx 2: Select * from Zone where Zoneid = 'Zone1' for update (waits)
    Tx 100: Select * from Zone where Zoneid = 'Zone1' for update
    Tx1 commits.
    It appears that the following transactions, i.e. Tx2 - Tx100 do not seem to execute in the order the lock was requested. That is Tx 100 always appears to be the second last transaction to execute, after which some arbitrary transaction between Tx2 - Tx99 will execute after Tx100 has committed.
    This seems to tell me that the lock is not being handed in a FIFO manner and is causing us great pain as our data is not longer consistent.
    Does anyone know how i might be able to trace which transaction is being awarded the lock? Also if anyone has any suggestion on how to troubleshoot/solve this issue, greatly appreciated.
    TIA
    Prem

    Oracle does not have a lock queue/manager at all. The locked status of a record is essentially an attribute of the record itself. It is stored on the datablock header. When a transaction requests a lock and can't get it, and is willing to wait (SELECT FOR UPDATE without NOWAIT), it first spins while waiting for the lock (four times as I recall), then sleeps waiting for the lock. The the more times it sleeps before getting the lock, the longer it will sleep before trying again.
    What is likely happening here is that transaction 100 is still spinning when transaction 1 commits, so checks back more frequently and gets the lock first. The rest get the lock whenever they wake up and noone else has taken the lock.
    If you need the transaction to occur in order, then I do not think you can use Oracle's native locking mechanism. Depending on what exactly you are trying to do, you may want to look at Advanced Queueing, or possibly the built-in package DBMS_LOCK.
    HTH
    John

  • Lock record on query for single user

    Is there any way to use the on-lock trigger to lock a particular record as it is simply queried, instead of after a change has been made to it. For instance, if user A is viewing a queried record, and user b attempts to query the same record, then we would display a message to user b stating that the record is unavailable, or simply just skip it. I know that if a field in the current record is altered, forms recognizes the status of the record as 'CHANGED' and will then by default proceed to lock the record until a commit or rollback is issued. However, this is not what we are looking for. I have read a little about this, and I have seen an example through a datablock based upon a stored procedure, a ref cursor select for update statement. (NOTE: we are not basing our datablock on a stored procedure though)
    We have two scenarios that require this type of locking capability. The first simply queries one distinct record, and the second queries a distinct result of records.
    A select for update statement would suffice for the first scenario, i.e. if another user tries to query the same record, their query is denied; however, for the second scenario when two users perform the same query, user a is viewing record #1, and user b's program sees that record #1 is 'locked' and thus proceeds to the next record in the result .
    Any suggestions? Thanks in advance.
    Eric M Weiss

    You don't need to override on-lock you can just call the LOCK_RECORD built-in in POST-QUERY or whatever.

  • Help - Stored Procedure/datablock question

    I have a fair understanding, but I'm a bit confused right now. Here' the scenario:
    For performance reasons, I have many tables that I want to load using stored procedures. They are all "look up" tables and don't need to be updated.
    How do I call a stored procedure and populate my datablock?
    Could someone post sample code for the stored procedure and how I integrate that into a data block? THANKS!!!!!
    null

    Bert,
    Create your stored procedures in the database.
    Choose the data block you need populated.
    Select the Data Block Wizard and choose Stored Procedure. Enter the Procedure name as stored in the database, click refresh and you are on your way.
    You will be prompted for each type of operation(the first screen is Select, the next INS, UPD, LOCK). Use the procedures you have defined as appropriate to each screen and Forms does all the work for you. You can define arguments to the procedures if necessary on each of the screens.

  • Attempting to join datablocks

    Quite new to forms development so forgive the mundane
    questions. I am attempting to effectively join to tables into
    something that acts like a single datablock.
    Table A Table B
    PK Fact1 FK Fact2
    1 a 1 x
    2 b 2 y
    3 c 3 z
    4 d 4 zz
    I want to be able to display on a single form the result of a
    select from Table A and Table B Where PK=FK. I would like it to
    act as though selected from a single block EG When Scrolling
    down one column, the other is synchronized to the equivalent
    record (fact1=c when fact2=z)
    I can do this by providing a view in the database, and building
    the datablock on the view, but I haven't yet done it up in the
    form level.
    If someone could point me in the direction of some answers, or
    better yet provide me with answers, I would be greatly
    appreciative.
    Thanks Andrew G
    PS Please respond to my email address as well as the newsgroup.
    Thanks Again.
    null

    Andrew Galbraith (guest) wrote:
    : Quite new to forms development so forgive the mundane
    : questions. I am attempting to effectively join to tables into
    : something that acts like a single datablock.
    : Table A Table B
    : PK Fact1 FK Fact2
    : 1 a 1 x
    : 2 b 2 y
    : 3 c 3 z
    : 4 d 4 zz
    : I want to be able to display on a single form the result of a
    : select from Table A and Table B Where PK=FK. I would like it
    to
    : act as though selected from a single block EG When Scrolling
    : down one column, the other is synchronized to the equivalent
    : record (fact1=c when fact2=z)
    : I can do this by providing a view in the database, and building
    : the datablock on the view, but I haven't yet done it up in the
    : form level.
    : If someone could point me in the direction of some answers, or
    : better yet provide me with answers, I would be greatly
    : appreciative.
    : Thanks Andrew G
    : PS Please respond to my email address as well as the newsgroup.
    : Thanks Again.
    You are at the right way by defining a view in the database and
    using the view as base table. The problem will be that this view
    will not be updatable, or not all of the columns of the view. So,
    if you try to update a record in your form you will get a error
    message like 'Cannot insert or update data in a view'.
    Workaround:
    you need to overwrite the standard handling of forms by
    implementing the following block triggers:
    - on-lock
    - on-insert
    - on-delete
    - on-update
    I'll send a you a document wich describes the steps in detail. If
    anyone else is interested in this, he or she can get this
    document too, just email to me.
    peter
    null

  • 先library cache pin还是先library cache lock??

    Question from Oracler:
    session1 给test 建主键
    session2 select test 出现library cache lock
    session3 select test 出现library cache pin
    不是说先获得library cache lock再library cache pin吗
    session1以exclusive模式获得 library cache lock
    session2 以shared模式请求 library cache lock ,session1未释放,所以session2 wait
    那session3 什么解释呢????

    as maclean answer:
    SQL> select * from V$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    session A  SQL> alter table maclean add a10 char(2000) default 'maclean';
    session B:  select 1 from maclean where rownum=1;      ==> hang here !
    session C:  select 1 from maclean where rownum=1;   ==> SAME SQL, hang here !
    SQL> select event from v$session where event like 'library%';
    EVENT
    library cache lock
    library cache pin
    session 4:
    SQL> oradebug setmypid;
    Statement processed.
    SQL> oradebug dump systemstate 266;
    Statement processed.
    SQL> oradebug tracefile_name;
    /s01/admin/G10R21/udump/g10r21_ora_6208.trc
        SO: 0x84f5b4a8, type: 4, owner: 0x84e5d4f8, flag: INIT/-/-/0x00
        (session) sid: 142 trans: (nil), creator: 0x84e5d4f8, flag: (41) USR/- BSY/-/-/-/-/-
                  DID: 0001-0010-00000027, short-term DID: 0000-0000-00000000
                  txn branch: (nil)
                  oct: 3, prv: 0, sql: 0x7bf10088, psql: 0x7bf582f0, user: 0/SYS
        O/S info: user: oracle, term: pts/1, ospid: 6159, machine: vrh8.oracle.com
                  program: [email protected] (TNS V1-V3)
        application name: [email protected] (TNS V1-V3), hash value=0
        waiting for 'library cache lock' blocking sess=0x(nil) seq=23 wait_time=0 seconds since wait started=17
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
        Dumping Session Wait History
         for 'library cache lock' count=1 wait_time=2149666
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930643
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930300
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930715
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930545
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2929985
    session 142 is  B  waiting for library cache lock
    the lock handle address is 7c3a5560
            SO: 0x8003b350, type: 53, owner: 0x84f98ba0, flag: INIT/-/-/0x00
            LIBRARY OBJECT LOCK: lock=8003b350 handle=7c3a5560 request=S
            call pin=(nil) session pin=(nil) hpc=0005 hlc=0000
            htl=0x8003b3d0[0x7d034330,0x7d034330] htb=0x7d034330 ssga=0x7e9f2168
            user=84f5b4a8 session=84f5b4a8 count=0 flags=RES/[0010] savepoint=0x1f9
            LIBRARY OBJECT HANDLE: handle=7c3a5560 mutex=0x7c3a5690(0)
            name=SYS.MACLEAN
            hash=458787ae49fd6f284ccb04a892b38231 timestamp=02-09-2012 21:32:36
            namespace=TABL flags=KGHP/TIM/SML/[02000000]
            kkkk-dddd-llll=0000-0701-0701 lock=X pin=X latch#=3 hpc=0006 hlc=0004
            lwt=0x7c3a5608[0x8003b380,0x8003b380] ltm=0x7c3a5618[0x7c3a5618,0x7c3a5618]
            pwt=0x7c3a55d0[0x7c3a55d0,0x7c3a55d0] ptm=0x7c3a55e0[0x7c3a55e0,0x7c3a55e0]
            ref=0x7c3a5638[0x7c3a5638,0x7c3a5638] lnd=0x7c3a5650[0x7bf75a18,0x7bf90650]
              LIBRARY OBJECT: object=7c1dec60
              type=TABL flags=EXS/LOC/UPD[0905] pflags=[0000] status=VALD load=0
              DATA BLOCKS:
              data#     heap  pointer    status pins change whr
                  0 7c3a54a0 7c1ded78 I/P/A/-/-    0 NONE   00
                  8 7c1de7f0 7e33ed48 I/P/A/-/-    1 UPDATE 00
                  9 7c1de8c0 7bf109e8 I/P/A/-/-    1 NONE   00
                 10 7c1de948 7bf10600 I/P/A/-/-    1 NONE   00
    关于session B的 library cache lock , 其原因是 add column 的session A 以 X mode lock SYS.MACLEAN, X mode pin  SYS.MACLEAN 且不释放, 所以session B的 library cache lock不用多解释
    session C:
        SO: 0x84f5dd18, type: 4, owner: 0x84e5dce0, flag: INIT/-/-/0x00
        (session) sid: 144 trans: (nil), creator: 0x84e5dce0, flag: (41) USR/- BSY/-/-/-/-/-
                  DID: 0001-0011-0000000A, short-term DID: 0000-0000-00000000
                  txn branch: (nil)
                  oct: 3, prv: 0, sql: 0x7bf10088, psql: 0x7bf582f0, user: 0/SYS
        O/S info: user: oracle, term: pts/2, ospid: 6183, machine: vrh8.oracle.com
                  program: [email protected] (TNS V1-V3)
        application name: [email protected] (TNS V1-V3), hash value=0
        waiting for 'library cache pin' blocking sess=0x(nil) seq=19 wait_time=0 seconds since wait started=17
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
        Dumping Session Wait History
         for 'library cache pin' count=1 wait_time=2568684
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2930677
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2929805
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2931420
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2930258
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
    session 144 is session C , waiting for library cache pin
    handle address 7bf46e40=>  指向 一个 child cursor namespace=CRSR, 而这个child cursor已经被 session B pin住了:
          SO: 0x7f03f890, type: 54, owner: 0x84f5dd18, flag: INIT/-/-/0x00
          LIBRARY OBJECT PIN: pin=7f03f890 handle=7bf46e40 request=S lock=0
          user=84f5dd18 session=84f5dd18 count=0 mask=0000 savepoint=0x3f flags=[00]
          SO: 0x7ec4cc80, type: 53, owner: 0x84f5dd18, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=7ec4cc80 handle=7bf46e40 mode=N
          call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
          htl=0x7ec4cd00[0x7e449348,0x80c35108] htb=0x80c35108 ssga=0x80c34ff0
          user=84f5dd18 session=84f5dd18 count=1 flags=[0000] savepoint=0x0
          LIBRARY OBJECT HANDLE: handle=7bf46e40 mutex=0x7bf46f70(0)
          namespace=CRSR flags=RON/KGHP/PN0/[10010000]
          kkkk-dddd-llll=0000-0001-0000 lock=N pin=X latch#=3 hpc=0004 hlc=0004
          lwt=0x7bf46ee8[0x7bf46ee8,0x7bf46ee8] ltm=0x7bf46ef8[0x7bf46ef8,0x7bf46ef8]
          pwt=0x7bf46eb0[0x7f03f8c0,0x7f03f8c0] ptm=0x7bf46ec0[0x7bf46ec0,0x7bf46ec0]
          ref=0x7bf46f18[0x7bf7bfe0,0x7bf7bfe0] lnd=0x7bf46f30[0x7bf46f30,0x7bf46f30]
            LIBRARY OBJECT: object=7bf29018
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            READ ONLY DEPENDENCIES: count=1 size=16
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 7bf20060 7bf28ba8 I/P/A/-/-    0 NONE   00
                6 7bf77a20 7bf776f8 I/P/A/-/-    1 NONE   00
    我们可以找到 上面这个child cursor 的 parent cursor :
          SO: 0x7d03b620, type: 53, owner: 0x84f5b4a8, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=7d03b620 handle=7bf10088 mode=N
          call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
          htl=0x7d03b6a0[0x7d034030,0x7c03c9f8] htb=0x7d034030 ssga=0x7e9f2168
          user=84f5b4a8 session=84f5b4a8 count=1 flags=[0000] savepoint=0x1f7
          LIBRARY OBJECT HANDLE: handle=7bf10088 mutex=0x7bf101b8(0)
          name=select 1 from maclean where rownum=1
          hash=324793c639b13d0954bd5421eaed6701 timestamp=03-08-2012 02:29:24
          namespace=CRSR flags=RON/KGHP/TIM/KEP/PN0/SML/DBN/[12010044]
          kkkk-dddd-llll=0001-0001-0001 lock=N pin=0 latch#=3 hpc=0004 hlc=0004
          lwt=0x7bf10130[0x7bf10130,0x7bf10130] ltm=0x7bf10140[0x7bf10140,0x7bf10140]
          pwt=0x7bf100f8[0x7bf100f8,0x7bf100f8] ptm=0x7bf10108[0x7bf10108,0x7bf10108]
          ref=0x7bf10160[0x7bf10160,0x7bf10160] lnd=0x7bf10178[0x82f4f2f8,0x7bf4d608]
            LIBRARY OBJECT: object=7bf7c8a8
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            CHILDREN: size=16
            child#    table reference   handle
                 0 7bf7c370  7bf7bfe0 7bf46e40                           => 只有一个child  handle 7bf46e40                          
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 7bf2a428 7bf7c9c0 I/P/A/-/-    0 NONE   00即在session B parse SQL "select 1 from maclean where rownum=1" 的时候, 会生成一个child cursor 并 X mode pin住这个child cursor , 而session C 同时发起 一样的SQL语句 "select 1 from maclean where rownum=1" 时 需要 share 这个child cursor , 即以 S mode pin 这个child cursor , 但是session B 还没有完成 optimize 没有生成完整的child cursor , 需要等待 session A 释放 library cache lock才能 完成, 所以 session C 要等 session B build child cursor , 此时session C等" library cache pin" ;
    如果 session C 执行的是不一样的SQL,那么 session C 不share 同一个child cursor , session C 会wait for library cache lock.
    since 10.2.0.3 "_kks_use_mutex_pin"=TRUE or 11g 开始 使用mutex 保护cursor pin ,所以 session C 若执行 与session B 一样的SQL,那么 wiat for cursor pin S on X
    SQL> select * from V$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    session A:
    SQL> alter table test add t11 char(2000) default 'maclean';
    session B:
    SQL> select * from test where rownum=1;
    session C:
    SQL> select * from test where rownum=1;
    SQL> select event from v$session where wait_class='Concurrency';
    EVENT
    cursor: pin S wait on X
    library cache lock
    SQL> oradebug setmypid;
    Statement processed.
    SQL> oradebug dump systemstate 266;
    Statement processed.
    session C:
    SO: 0x9e2256b8, type: 4, owner: 0x9e59a1c0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e59a1c0, name=session, file=ksu.h LINE:12624, pg=0
    (session) sid: 179 ser: 41307 trans: (nil), creator: 0x9e59a1c0
    flags: (0x41) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
    flags2: (0x40009) -/-/INC
    DID: , short-term DID:
    txn branch: (nil)
    oct: 3, prv: 0, sql: 0x956e18b8, psql: 0x956e18b8, user: 0/SYS
    ksuxds FALSE at location: 0
    service name: SYS$USERS
    client details:
    O/S info: user: oracle, term: pts/3, ospid: 26823
    machine: vrh1.oracle.com program: [email protected] (TNS V1-V3)
    application name: [email protected] (TNS V1-V3), hash value=1481565533
    Current Wait Stack:
    0: waiting for 'cursor: pin S wait on X'
    idn=0xe76d0d8c, value=0xca00000000, where=0x500000000
    wait_id=17 seq_num=18 snap_id=1
    wait times: snap=12.671273 sec, exc=12.671273 sec, total=12.671273 sec
    wait times: max=infinite, heur=12.671273 sec
    wait counts: calls=1148 os=1148
    in_wait=1 iflags=0x15b2
    There is at least one session blocking this session.
    Dumping 1 direct blocker(s):
    inst: 1, sid: 202, ser: 15511
    Dumping final blocker:
    inst: 1, sid: 9, ser: 1
    Wait State:
    fixed_waits=0 flags=0x22 boundary=(nil)/-1
    idn=0xe76d0d8c=> 这个是mutex的标示
    KGX Atomic Operation Log 0x94aa8ca8
    Mutex 0x8a328978(202, 0) idn e76d0d8c oper GET_SHRD
    Cursor Pin uid 179 efd 0 whr 5 slp 1148
    opr=2 pso=0x8b5a8c48 flg=0
    pcs=0x8a3288e0 nxt=(nil) flg=35 cld=1 hd=0x93d4bbb8 par=0x8a328048
    ct=1 hsh=0 unp=(nil) unn=0 hvl=8a328ef0 nhv=1 ses=0x9e1e0ea0
    hep=0x8a328978 flg=80 ld=1 ob=0x939a30b0 ptr=0x935e0348 fex=0x935df6f0
    这个mutex的 oper是 GET_SHRD 即 pin S 它指向 0x93d4bbb8 是一个child cursor
    以下是parent cursor:
    SO: 0x957fa9d8, type: 78, owner: 0x9e1e0ea0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e593da0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8547, pg=0
    LibraryObjectLock: Address=0x957fa9d8 Handle=0x956e18b8 Mode=N CanBeBrokenCount=1 Incarnation=1 ExecutionCount=0
    User=0x9e1e0ea0 Session=0x9e1e0ea0 ReferenceCount=1 Flags=CNB/[0001] SavepointNum=4f5864b8
    LibraryHandle: Address=0x956e18b8 Hash=e76d0d8c LockMode=N PinMode=0 LoadLockMode=0 Status=VALD
    ObjectName: Name=select * from test where rownum=1
    FullHashValue=7e277fabf95d7c80e8924ed6e76d0d8c Namespace=SQL AREA(00) Type=CURSOR(00) Identifier=3882683788 OwnerIdn=0
    Statistics: InvalidationCount=1 ExecutionCount=2 LoadCount=3 ActiveLocks=2 TotalLockCount=4 TotalPinCount=1
    Counters: BrokenCount=1 RevocablePointer=1 KeepDependency=1 BucketInUse=3 HandleInUse=3 HandleReferenceCount=0
    Concurrency: DependencyMutex=0x956e1968(0, 2, 0, 0) Mutex=0x956e19e8(0, 45, 0, 0)
    Flags=RON/PIN/TIM/PN0/DBN/[10012841]
    WaitersLists:
    Lock=0x956e1948[0x956e1948,0x956e1948]
    Pin=0x956e1928[0x956e1928,0x956e1928]
    LoadLock=0x956e19a0[0x956e19a0,0x956e19a0]
    Timestamp: Current=03-08-2012 02:45:45
    HandleReference: Address=0x956e1a78 Handle=(nil) Flags=[00]
    LibraryObject: Address=0x8a327fa8 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
    ChildTable: size='16'
    Child: id='0' Table=0x8a328e58 Reference=0x8a3288b8 Handle=0x956db988
    Child: id='1' Table=0x8a328e58 Reference=0x8a328b80 Handle=0x93d4bbb8
    NamespaceDump:
    Parent Cursor: sql_id=fj4kfuvmqu3cc parent=0x8a328048 maxchild=2 plk=y ppn=n
    但是很可惜 0x93d4bbb8 这个 child cursor 被 session B pin住了:
    SO: 0x957fa8d8, type: 78, owner: 0x9e1e0ea0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e593da0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8547, pg=0
    LibraryObjectLock: Address=0x957fa8d8 Handle=0x93d4bbb8 Mode=N CanBeBrokenCount=1 Incarnation=1 ExecutionCount=0
    ClusterLock=0x8f1945f8 Context=0x7fd379518308 User=0x9e1e0ea0 Session=0x9e1e0ea0 ReferenceCount=1
    Flags=CBK/[0020] SavepointNum=0
    LibraryHandle: Address=0x93d4bbb8 Hash=0 LockMode=N PinMode=X LoadLockMode=0 Status=VALD
    Name: Namespace=SQL AREA(00) Type=CURSOR(00)
    Statistics: InvalidationCount=0 ExecutionCount=0 LoadCount=1 ActiveLocks=2 TotalLockCount=2 TotalPinCount=3
    Counters: BrokenCount=1 RevocablePointer=1 KeepDependency=0 BucketInUse=0 HandleInUse=0 HandleReferenceCount=0
    Concurrency: DependencyMutex=0x93d4bc68(0, 0, 0, 0) Mutex=0x956e19e8(0, 45, 0, 0)
    Flags=RON/PIN/PN0/EXP/CHD/[10012111]
    WaitersLists:
    Lock=0x93d4bc48[0x93d4bc48,0x93d4bc48]
    Pin=0x93d4bc28[0x93d4bc28,0x93d4bc28]
    LoadLock=0x93d4bca0[0x93d4bca0,0x93d4bca0]
    LibraryObject: Address=0x939a30b0 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
    DataBlocks:
    Block: #='0' name=KGLH0^e76d0d8c pins=0 Change=NONE
    Heap=0x93d1a808 Pointer=0x939a3150 Extent=0x939a3030 Flags=I/-/P/A/-/-
    FreedLocation=0 Alloc=1.546875 Size=4.000000 LoadTime=4385736620
    Block: #='6' name=SQLA^e76d0d8c pins=0 Change=NONE
    Heap=0x8a328a20 Pointer=0x935e0348 Extent=0x935df6f0 Flags=I/-/P/A/-/E
    FreedLocation=0 Alloc=0.000000 Size=0.000000 LoadTime=0
    NamespaceDump:
    Child Cursor: Heap0=0x939a3150 Heap6=0x935e0348 Heap0 Load Time=03-08-2012 02:50:16 Heap6 Load
    PinMode=X
    保持这个 X mode pin的是另外一个 mutex , 这个mutex的 oper是 LONG_EXCL
    Time=03-08-2012 02:50:16 ----------------------------------------
    KGX Atomic Operation Log 0x8f1945f8
    Mutex 0x8a328978(202, 0) idn e76d0d8c oper LONG_EXCL
    Cursor Pin uid 202 efd 0 whr 1 slp 0
    opr=3 pso=0x957fa8d8 flg=0
    pcs=0x8a3288e0 nxt=(nil) flg=35 cld=1 hd=0x93d4bbb8 par=0x8a328048
    ct=1 hsh=0 unp=(nil) unn=0 hvl=8a328ef0 nhv=1 ses=0x9e1e0ea0
    hep=0x8a328978 flg=80 ld=1 ob=0x939a30b0 ptr=0x935e0348 fex=0x935df6f0

  • Locking the record against update

    Hi all,
    I have a multirow database datablock. Some records I would like to lock against the update, and these records SHOULD be displayed as disabled - does not be able to be selected. So, the changing of default_where does not pass, becose the records should be displayed. Has anyone an Idea how to provide this?
    Regards

    Hi,
    thanks for your updates.
    The solution, that I need is:
    Making the current record in the detail block non-updateable.
    Regards

  • MSI Forum Lock Ups

    Hey guys wondering where i have been the last couple of days??...no, you guessed wrong i was not with my girlfriend (well at least no during daytime :D )
    I was trying to LOGIN IN THE F*****G FORUM :O  ?(
    Markoul
    p.s. At least it seems now we are going to have Avatars and also we have got the old forum back  :P

    Hi,
    First of all thanks to all for the help, and CJLittle...LMAO !  My car is a Scooby and a nice blue paint job !  Believe it or not they assured me all this would work.. I bought it in one package and even questioned it.  Also to be fair up until then they had always been very good... shows they have no zero about 3200XP 200 fsbetc...  When I went back with the power supply and told them they changed it out and let me off on the extra money it should have been.
    The crashes are as follows :-
    [list=1]
    Locks up after random amounts of time in games, sometimes dont even get to load it up at all, other times I can play 2 hours.  When the games lock up usually there is a high pitch squeal and can only get out of it by reset or power off.
    I cannot install Zone Alarm Pro or Agnitum Outpost are 2 anyway (there are others) these just come up with the installer screen and hangs there, I have to go to Task Manager to close them down, unlike the lock up in games.
    The cooler is the Coolermaster Jet... and the temperature is more than acceptable (right now is 44 C) so I cannot see that at all being a factor.
    leds are on on the d bracket when it locks, I did not know of this function and will check it out. Thanks for that tip.[/list=1]
    Question from me: would the 2700 RAM cause these lockups ?  I would have thought it would just not work at all ?  If this is possible then I will go and change out the RAM as tuning it down to 166 (if it is possible) does not appeal to me !  But yes it may show what the problem is.
    Thanks again, will see what happens...

  • Bit locker Mutliple Drives Mutliple OS's

    I have a laptop with two hard drive in it.  The primary has Windows 7 Enterprise and is a member of the corporate domain.  The secondary has Server 2008 R2 and is a member of the lab domain.  There is no trust or association between domain. 
    The laptop does the Windows multi-boot off the primary drive.  I want to enable bit locker to secure the drives.
    If the two windows environments were exclusively separate, setting up bit locker on each drive independently would be pretty straight forward, but when I'm in one OS, I will frequently need to get files and data from the other drive (and no, making each
    drive big enough to hold all it's own data is not an option, plus the synchronization headache).  Both drives will need to be bit locked to their respective OS, but the other drive will need to be accessible.
    And not to make things too easy, the secondary drive, which i put in an optical drive bay carrier, routinely gets pulled (not while the system is running, of course) out and popped into a USB case to be used as a library transfer drive. 
    So....
    the Windows 7 drive needs to be natively bit locked.  and be accessible when running Windows 2008 from the second drive.
    the Windows 2008 R2 drive needs to be natively bit locked, and be accessible when running Windows 7 from the first drive, and be accessible when run as a stand-alone USB drive on another system.
    I would appreciate any wisdom you can share to make this all work.  And please presume that i know next to nothing about installing and running bit locker, because that's pretty much true.
    Let me know if you need more information about my configuration.
    Thanks

    Hi,
    "and be accessible when run as a stand-alone USB drive on another system."
    Firstly, if you enable bitlocker for one drive, it will be encrypted always until you decrypt it. Thus after you insert it to any system, it need to enter the credential to access it.
    And then, if you want to access one drive in another computer, you need to get the shared permission. After you' re granted the sufficient permission, you could access it no matter if it's encrypted. Of course, another computer must be started.
    Karen Hu
    TechNet Community Support

  • FORMAT WINDOWS 7(64) BY MISTAKEN NOW HOW I RECOVER ERASED DATA WHICH I HAD LOCKED DRIVE BY BIT LOCKER

    i'm using windows 7 (64 bit) but experiment to install mac on my PC (i 5-4 GB ddr 3-500sata sea gate).by mistaken its format my whole hard drive which is 500 GB sea gate sata.after this i'm confused and install windows 8.1 and then again i had install windows
    7 (64 bit) now after 2 time partition erased i'm trying to recover my data 50 percent data but which drive i had locked with windows 7 bit locker it cant recover any thing I've remember its password.
    any one help me to get back my data from this locked drive ?
      

    RB
    If the drive was both formatted and bit locked you cannot recover your data.
    Wanikiya and Dyami--Team Zigzag

  • USB 6009 lock-ups?

    Hello,
    I'm having a strange problem with my newly aquired USB 6009. I've written an app to read the temperature from a temperature controller using the 6009 and that all works fine. However, the problem comes when I port this code into another application. The code is intended to run in a parallel loop to the main execution loop, to continuously read the temperature whilst other data is captured and process (all done in the main loop). Both applications run quite happily when separate. When I bring them together the applications sometimes, but not all the time, refuse to quit and just lock up. I have no idea what is happening as it is not a case of one loop remaining running (I've tried separate stop buttons) and they will run together quite happily. The problem only comes when I hit the button that terminates the main loop (this also triggers the other loop to stop - I'm sure this bit works as I've used the same method in another vi).
    The main loop should, in theory, just close. The loop with the USB reads (using DAQmx Base) will stop and then clear the task (DAQmx Base Clear I think). Sometimes the DAQmx Base Clear runs and the program stops fine, other times it runs and the program locks, other times it locks as soon as I hit the quit button.
    Any thoughts as I'm completely stumped on this one? Like I say, apart from the one button triggering both loops to terminate there is no link between the two loops.
    My only thought is it could be a USB issue as the PC also has a USB keyboard and mouse. I know from my home experience, when for instance plugging in my camera, it can cause the USB to lock if, say, my USB modem is running.

    See the thread
    http://forums.ni.com/ni/board/message?board.id=250&message.id=13722
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • Hot Synch Lock-Ups

    I have a Palm Z22, when I hotsynch with outlook, all goes just fine untill I reach expenses, then it locks up on CitiesDb.  It used to lock up on a different Db.   Why is this, can I skip it, how can I make it stop.  I have to end the task on the PC and reset the handheld everytime (Lucklily it is after it is giving me what I need with Synching calendar, tasks, and contacts
    Post relates to: Palm Z22

    scooter_95126, please don't double-post the same message.  I've combined both posts into one here.
    Thanks!
    WyreNut
    Post relates to: Centro (AT&T)
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

Maybe you are looking for