Locking row causes transaction to become dirty?

Should locking a row with the lock() method cause the transaction to become dirty?
getLogger().debug("Dirty?"+getApplicationModule().getTransaction().isDirty());
getLogger().debug("Dirty?"+getPanelBinding().getApplication().isTransactionDirty());
               peopleSearchRow.lock();
getLogger().debug("Dirty?"+getApplicationModule().getTransaction().isDirty());
getLogger().debug("Dirty?"+getPanelBinding().getApplication().isTransactionDirty());
returns:
false
false
true
true
I also hava a DCTransacitonStateListener added to my JUApplication, the transactionStateChanged() method is never fired on it, so I get no notification that the transaction has become dirty.
Just upgraded to 9.0.5 from 9.0.4, and I dont seem to recall this being an issue in 9.0.4.
Jeff

Needing a commit or a rollback makes sense but the transaction listener not firing doesn't. Setting the transaction modified manually fixes my problem but is this a bug?
I guess what I'm looking for is is there a way to tell if data has changed, not just if the transaction is dirty.

Similar Messages

  • Re: Transactions and Locking Rows for Update

    Dale,
    Sounds like you either need an "optimistic locking" scheme, usually
    implemented with timestamps at the database level, or a concurrency manager.
    A concurrency manager registers objects that may be of interest to multiple
    users in a central location. It takes care of notifying interested parties
    (i.e., clients,) of changes made to those objects, using a "notifier" pattern.
    The optimistic locking scheme is relatively easy to implement at the
    database level, but introduces several problems. One problem is that the
    first person to save their changes "wins" - every one else has to discard
    their changes. Also, you now have business policy effectively embedded in
    the database.
    The concurrency manager is much more flexible, and keeps the policy where
    it probably belongs. However, it is more complex, and there are some
    implications to performance when you get to the multiple-thousand-user
    range because of its event-based nature.
    Another pattern of lock management that has been implemented is a
    "key-based" lock manager that does not use events, and may be more
    effective at managing this type of concurrency for large numbers of users.
    There are too many details to go into here, but I may be able to give you
    more ideas in a separate note, if you want.
    Don
    At 04:48 PM 6/5/97 PDT, Dale "V." Georg wrote:
    I have a problem in the application I am currently working on, which it
    seems to me should be easily solvable via appropriate use of transactions
    and database locking, but I'm having trouble figuring out exactly how to
    do it. The database we are using is Oracle 7.2.
    The scenario is as follows: We have a window where the user picks an
    object from a dropdown list. Some of the object's attributes are then
    displayed in that window, and the user then has the option of editing
    those attributes, and at some point hitting the equivalent of a 'save'button
    to write the changes back to the database. So far, so good. Now
    introduce a second user. If user #1 and user #2 both happen to pull up
    the same object and start making changes to it, user #1 could write back
    to the database and then 15 seconds later user #2 could write back to the
    database, completely overlaying user #1's changes without ever knowing
    they had happened. This is not good, particularly for our application
    where editing the object causes it to progress from one state to the next,
    and multiple users trying to edit it at the same time spells disaster.
    The first thing that came to mind was to do a select with intent to update,
    i.e. 'select * from table where key = 'somevalue' with update'. This way
    the next user to try to select from the table using the same key would not
    be able to get it. This would prevent multiple users from being able to
    pull the same object up on their screens at the same time. Unfortunately,
    I can think of a number of problems with this approach.
    For one thing, the lock is only held for the duration of the transaction, so
    I would have to open a Forte transaction, do the select with intent to
    update, let the user modify the object, then when they saved it back again
    end the transaction. Since a window is driven by the event loop I can't
    think of any way to start a transaction, let the user interact with the
    window, then end the transaction, short of closing and re-opening the
    window. This would imply having a separate window specifically for
    updating the object, and then wrapping the whole of that window's event
    loop in a transaction. This would be a different interface than we wanted
    to present to the users, but it might still work if not for the next issue.
    The second problem is that we are using a pooled DBSession approach
    to connecting to the database. There is a single Oracle login account
    which none of the users know the password to, and thus the users
    simply share DBSession resources. If one user starts a transaction
    and does a select with intent to update on one DBSession, then another
    user starts a transaction and tries to do the same thing on the same
    DBSession, then the second user will get an error out of Oracle because
    there's already an open transaction on that DBSession.
    At this point, I am still tossing ideas around in my head, but after
    speaking with our Oracle/Forte admin here, we came to the conclusion
    that somebody must have had to address these issues before, so I
    thought I'd toss it out and see what came back.
    Thanks in advance for any ideas!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    >
    >
    >
    >
    ====================================
    Don Nelson
    Senior Consultant
    Forte Software, Inc.
    Denver, CO
    Corporate voice mail: 510-986-3810
    aka: [email protected]
    ====================================
    "I think nighttime is dark so you can imagine your fears with less
    distraction." - Calvin

    We have taken an optimistic data locking approach. Retrieved values are
    stored as initial values; changes are stored seperately. During update, key
    value(s) or the entire retieved set is used in a where criteria to validate
    that the data set is still in the initial state. This allows good decoupling
    of the data access layer. However, optimistic locking allows multiple users
    to access the same data set at the same time, but then only one can save
    changes, the rest would get an error message that the data had changed. We
    haven't had any need to use a pessimistic lock.
    Pessimistic locking usually involves some form of open session or DBMS level
    lock, which we haven't implemented for performance reasons. If we do find the
    need for a pessimistic lock, we will probably use cached data sets that are
    checked first, and returned as read-only if already in the cache.
    -DFR
    Dale V. Georg <[email protected]> on 06/05/97 03:25:02 PM
    To: Forte User Group <[email protected]> @ INTERNET
    cc: Richards* Debbie <[email protected]> @ INTERNET, Gardner*
    Steve <[email protected]> @ INTERNET
    Subject: Transactions and Locking Rows for Update
    I have a problem in the application I am currently working on, which it
    seems to me should be easily solvable via appropriate use of transactions
    and database locking, but I'm having trouble figuring out exactly how to
    do it. The database we are using is Oracle 7.2.
    The scenario is as follows: We have a window where the user picks an
    object from a dropdown list. Some of the object's attributes are then
    displayed in that window, and the user then has the option of editing
    those attributes, and at some point hitting the equivalent of a 'save' button
    to write the changes back to the database. So far, so good. Now
    introduce a second user. If user #1 and user #2 both happen to pull up
    the same object and start making changes to it, user #1 could write back
    to the database and then 15 seconds later user #2 could write back to the
    database, completely overlaying user #1's changes without ever knowing
    they had happened. This is not good, particularly for our application
    where editing the object causes it to progress from one state to the next,
    and multiple users trying to edit it at the same time spells disaster.
    The first thing that came to mind was to do a select with intent to update,
    i.e. 'select * from table where key = 'somevalue' with update'. This way
    the next user to try to select from the table using the same key would not
    be able to get it. This would prevent multiple users from being able to
    pull the same object up on their screens at the same time. Unfortunately,
    I can think of a number of problems with this approach.
    For one thing, the lock is only held for the duration of the transaction, so
    I would have to open a Forte transaction, do the select with intent to
    update, let the user modify the object, then when they saved it back again
    end the transaction. Since a window is driven by the event loop I can't
    think of any way to start a transaction, let the user interact with the
    window, then end the transaction, short of closing and re-opening the
    window. This would imply having a separate window specifically for
    updating the object, and then wrapping the whole of that window's event
    loop in a transaction. This would be a different interface than we wanted
    to present to the users, but it might still work if not for the next issue.
    The second problem is that we are using a pooled DBSession approach
    to connecting to the database. There is a single Oracle login account
    which none of the users know the password to, and thus the users
    simply share DBSession resources. If one user starts a transaction
    and does a select with intent to update on one DBSession, then another
    user starts a transaction and tries to do the same thing on the same
    DBSession, then the second user will get an error out of Oracle because
    there's already an open transaction on that DBSession.
    At this point, I am still tossing ideas around in my head, but after
    speaking with our Oracle/Forte admin here, we came to the conclusion
    that somebody must have had to address these issues before, so I
    thought I'd toss it out and see what came back.
    Thanks in advance for
    any
    ideas!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    ------ Message Header Follows ------
    Received: from pebble.Sagesoln.com by notes.bsginc.com
    (PostalUnion/SMTP(tm) v2.1.9c for Windows NT(tm))
    id AA-1997Jun05.162418.1771.334203; Thu, 05 Jun 1997 16:24:19 -0500
    Received: (from sync@localhost) by pebble.Sagesoln.com (8.6.10/8.6.9) id
    NAA11825 for forte-users-outgoing; Thu, 5 Jun 1997 13:47:58 -0700
    Received: (from uucp@localhost) by pebble.Sagesoln.com (8.6.10/8.6.9) id
    NAA11819 for <[email protected]>; Thu, 5 Jun 1997 13:47:56 -0700
    Received: from unknown(207.159.84.4) by pebble.sagesoln.com via smap (V1.3)
    id sma011817; Thu Jun 5 13:47:43 1997
    Received: from tes0001.macktrucks.com by relay.macktrucks.com
    via smtpd (for pebble.sagesoln.com [206.80.24.108]) with SMTP; 5 Jun
    1997 19:35:31 UT
    Received: from dale by tes0001.macktrucks.com (SMI-8.6/SMI-SVR4)
    id QAA04637; Thu, 5 Jun 1997 16:45:51 -0400
    Message-ID: <[email protected]>
    Priority: Normal
    To: Forte User Group <[email protected]>
    Cc: "Richards," Debbie <[email protected]>,
    "Gardner," Steve <[email protected]>
    MIME-Version: 1.0
    From: Dale "V." Georg <[email protected]>
    Subject: Transactions and Locking Rows for Update
    Date: Thu, 05 Jun 97 16:48:37 PDT
    Content-Type: text/plain; charset=US-ASCII; X-MAPIextension=".TXT"
    Content-Transfer-Encoding: quoted-printable
    Sender: [email protected]
    Precedence: bulk
    Reply-To: Dale "V." Georg <[email protected]>

  • How skip on locked rows

    hello
    please guide me
    sqlserver select as READPAST hint that cause skip on locked rows that another transaction locked it
    For example, assume table T1 contains a single integer column with the values of 1, 2, 3, 4, 5. If transaction A changes the value of 3 to 8 but has not yet committed, a SELECT * FROM T1 (READPAST) yields values 1, 2, 4, 5
    when i use oracle. how i can skip rows that another transaction locked it when i use "for update" in select statement?
    thanks

    There is some undocumented syntax "FOR UPDATE SKIP LOCKED" that does exactly this. Problem is that it is not supported and Oracle is free to remove or change the functionality.
    The other option is to program it like this:
    (pseudocode, not tested)
    declare
      l_pk_array is table of t1.<pk column>%type index by pls_integer;
      cursor c is select <pk column> from t1;
    begin
      open c;
      loop
        fetch c bulk collect into l_pk_array limit 100
        for i in 1..l_pk_array.count
        loop
          declare
            e_row_locked exception;
            pragma exception_init (e_row_locked,-54);
            <other arrays>
          begin
            select <other columns>
              into <other arrays>
              from t1
             where t1.pk_column = l_pk_array(i)
                   for update nowait
            <your code>
          exception
          when no_data_found then
            null;
          when e_row_locked then
            null;
          end;
        end loop
        <maybe a forall statement here>
      end loop
      close c;
    end;Regards,
    Rob.

  • Transaciton becomes dirty

    I have a table thats bound to a View Object that I use for searching. When I double click a row in the table it sets the current Row of another view object that is displayed on the page.
    The JTable is not editable and is declared like:
    searchResultsTable = new JTable(){
    public boolean isCellEditable(int r, int c) {
         return false;
    so it always returns false when an edit is attempted.
    Sometimes when I select rows in the table it makes the transaction dirty. I have a listener that disables/enables components (save button etc) when this happens. If the table is not editable and I am not editing any components how is the transaction becoming dirty by switching records? This behavior does not happen on every row selected, but happens regularly on certain rows.
    Could the current values of a selected row trigger the transaciton to be dirty?
    thanks
    Jeff

    Double click on a JTable by default calls setCellValue on it's model to dirty the model. If you want an alternate behavior, I'd suggest overriding editingStopped method on the table and perform appropriate value comparision before calling setValueAt.
        public void editingStopped(ChangeEvent e) {
            // Take in the new value
            TableCellEditor editor = getCellEditor();
            if (editor != null) {
                Object value = editor.getCellEditorValue();
                if (!value.toString().equals(getValueAt(value, editingRow, editingColumn).toString())
                   setValueAt(value, editingRow, editingColumn);
                removeEditor();

  • Identifying locked rows

    I have an uncommited session in one window and I'm attempting to locate the locked row for Oracle 10.2.0.4. I'm unable to locate the row successfully.
    I issue the following to retrieve the information on the session locking the row. I could clearly see the session holding a DML lock.
    SQLPLUS> select dbms_rowid.rowid_create (1, ROW_WAIT_OBJ#, ROW_WAIT_FILE#, ROW_WAIT_BLOCK#, ROW_WAIT_ROW#)
    from v$session where sid=1324;
    USERNAME START_TIME STATUS SID SERIAL# SECONDS_IN_WAIT SQL_ID SQL_FULLTEXT TY
    ALEX 08/25/11 20:36:30 INACTIVE 1199 30613 49 update test set CUSTOMER_ID=1235 where CUSTOMER_ID=11111 TM
    I select the detailed information of the location of the locked row to retrieve the RowID, but I'm not getting back the expected result. I'm getting back values -1,0,0,0 for columns ROW_WAIT_OBJ#, ROW_WAIT_FILE#, ROW_WAIT_BLOCK#, and ROW_WAIT_ROW# respectively. I can't locate the row with the following:
    select row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#
    from v$session where sid=1199;
    SQLPLUS> 2
    ROW_WAIT_OBJ# ROW_WAIT_FILE# ROW_WAIT_BLOCK# ROW_WAIT_ROW#
    -1 0 0 0
    How do I identify the locked updated row? I'm not able to in my test.
    Any help would be appreciated.
    Thanks

    user12006502,
    I am struggling to see EXACTLY what you are doing. You are showing output without showing the SQL statements that produce the output. Additionally, there may be foreign key or other constraints involved - as it stands, the best that I can do is guess, and I would prefer not to do that. For example, assume that your table name is T1 rather than TEST. What if, someone created an index like this:
    CREATE UNIQUE INDEX T1_CUSTOMER ON T1(DECODE(CUSTOMER,'KEITH','0','JOHN','0',CUSTOMER));
    {pre}
    Then, in that same session executed the following without a commit:
    INSERT INTO T1 VALUES ('JOHN',0);Now, in another session you enter the following:
    UPDATE T1 SET CUSTOMER='KEITH' WHERE CUSTOMER='RON';Your session then hangs for seemingly no reason.
    The person with the other session issues the following:
    SELECT
      SID,
      TYPE,
      ID1,
      ID2,
      LMODE,
      REQUEST,
      BLOCK
    FROM
      V$LOCK
    WHERE
      SID=(SELECT SID FROM V$MYSTAT WHERE ROWNUM=1);
    SID TY        ID1        ID2      LMODE    REQUEST      BLOCK
    222 AE        100          0          4          0          0
    222 TM      70568          0          3          0          0
    222 TX      65554       1424          6          0          1It seems that the first session has a TX lock that is blocking another session, a TM lock that is NOT blocking another session, and an AE lock that is not blocking another session.  Now, in that session, the following is executed:
    SELECT /*+ ORDERED */
      S.SID,
      S.STATUS,
      SW.EVENT,
      SW.WAIT_TIME WT,
      SW.STATE,
      SW.SECONDS_IN_WAIT S_I_W,
      S.SQL_ID,
      S.SQL_CHILD_NUMBER,
      S.ROW_WAIT_OBJ# OBJ#,
      S.ROW_WAIT_FILE# FILE#,
      S.ROW_WAIT_BLOCK# BLOCK#,
      S.ROW_WAIT_ROW# ROW#,
      SW.P1,
      SW.P2,
      SW.P3
    FROM
      V$SESSION_WAIT SW,
      V$SESSION S
    WHERE
      S.USERNAME IS NOT NULL
      AND SW.SID=S.SID
      AND SW.EVENT NOT LIKE '%SQL*Net%'
      AND SW.EVENT NOT IN ('Streams AQ: waiting for messages in the queue',
      'wait for unread message on broadcast channel');
    SID STATUS   EVENT                                 WT STATE                    S_I_W SQL_ID        SQL_CHILD_NUMBER       OBJ#      FILE#     BLOCK#       ROW#         P1         P2         P3
    223 ACTIVE   enq: TX - row lock contention          0 WAITING                    146 9gag614u0kvyx                0         -1          0          0          0 1415053316      65554       1424Notice in the above the -1 for the OBJ#.  You must provide the DDL and the DML for people to help you, otherwise you are forcing people to guess what you have done to set up the test case.
    At the minimum, provide the DDL to recreate the table (and any indexes).  If you do not have the DML, you can use the following technique to retrieve it:
    SET PAGESIZE 0
    SET LONG 90000
    SET LINESIZE 200
    COLUMN OBJECT_DEF FORMAT A200
    SPOOL 'GETMETA.SQL'
    SELECT
      DBMS_METADATA.GET_DDL('TABLE',TABLE_NAME,OWNER) OBJECT_DEF
    FROM
      DBA_TABLES
    WHERE
      TABLE_NAME IN ('T1');When I executed the above for my test table T1, I saw the following:
      CREATE TABLE "TESTUSER"."T1"
       (    "CUSTOMER" VARCHAR2(6),
            "CUSTOMER_ID" NUMBER
       ) SEGMENT CREATION IMMEDIATE
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "USER_DATA"That said, you could also have a trigger on the table that performs some action on an UPDATE, which could also cause problems.
    Here is an example of what a full test case would look like:
    DROP TABLE T1 PURGE;
    CREATE TABLE T1 (
      CUSTOMER VARCHAR2(6),
      CUSTOMER_ID NUMBER);
    INSERT INTO T1 VALUES('BETTY',1235);
    INSERT INTO T1 VALUES('RON',0);
    INSERT INTO T1 VALUES('BLAKE',0);
    COMMIT;In session 1 you execute the following and receive confirmation that the update was successful:
    UPDATE T1 SET CUSTOMER='KEITH' WHERE CUSTOMER='RON';
    1 row updated.You check V$LOCK for this session and notice that the session has 3 locks, none of which are blocking:
    SELECT
      SID,
      TYPE,
      ID1,
      ID2,
      LMODE,
      REQUEST,
      BLOCK
    FROM
      V$LOCK
    WHERE
      SID=(SELECT SID FROM V$MYSTAT WHERE ROWNUM=1);
    SID TY        ID1        ID2      LMODE    REQUEST      BLOCK
    223 AE        100          0          4          0          0
    223 TM      70568          0          3          0          0
    223 TX     262153       1493          6          0          0In another session, you attempt to drop the table and are greeted with an error:
    DROP TABLE T1 PURGE;
    DROP TABLE T1 PURGE
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expiredSo, you try the update statement - the same one performed in the first session:
    UPDATE T1 SET CUSTOMER='KEITH' WHERE CUSTOMER='RON';The session hangs.
    Back in the first session, you check the locks for the first session:
    SELECT
      SID,
      TYPE,
      ID1,
      ID2,
      LMODE,
      REQUEST,
      BLOCK
    FROM
      V$LOCK
    WHERE
      SID=(SELECT SID FROM V$MYSTAT WHERE ROWNUM=1);
    SID TY        ID1        ID2      LMODE    REQUEST      BLOCK
    223 AE        100          0          4          0          0
    223 TM      70568          0          3          0          0
    223 TX     262153       1493          6          0          1Note the blocking lock.
    Let's check the waits:
    SELECT /*+ ORDERED */
      S.SID,
      S.STATUS,
      SW.EVENT,
      SW.WAIT_TIME WT,
      SW.STATE,
      SW.SECONDS_IN_WAIT S_I_W,
      S.SQL_ID,
      S.SQL_CHILD_NUMBER,
      S.ROW_WAIT_OBJ# OBJ#,
      S.ROW_WAIT_FILE# FILE#,
      S.ROW_WAIT_BLOCK# BLOCK#,
      S.ROW_WAIT_ROW# ROW#,
      SW.P1,
      SW.P2,
      SW.P3
    FROM
      V$SESSION_WAIT SW,
      V$SESSION S
    WHERE
      S.USERNAME IS NOT NULL
      AND SW.SID=S.SID
      AND SW.EVENT NOT LIKE '%SQL*Net%'
      AND SW.EVENT NOT IN ('Streams AQ: waiting for messages in the queue',
      'wait for unread message on broadcast channel');
    SID STATUS   EVENT                                 WT STATE                    S_I_W SQL_ID        SQL_CHILD_NUMBER       OBJ#      FILE#     BLOCK#       ROW#         P1         P2         P3
    222 ACTIVE   enq: TX - row lock contention          0 WAITING                    333 9gag614u0kvyx                1      70568          4      42601          1 1415053318     262153       1493Notice that the second session is waiting in an enqueue, the STATE is WAITING and the OBJ#, FILE#, BLOCK#, and ROW# all contain values.
    Please provide a full test case, otherwise people may provide to you an answer that has nothing to do with the question that you are asking.
    Notice in the above that the spaces were retained in my posted output from the SQL statements.  To do the same, place the following tag before and after your code sections (do not include the space before and after the brackets):
    { code }
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How To find rowid of Locked row.

    Hello,
    can somebody tell me the "select statement", how to find the rowid of a locked row, which is locked by "select for update" and also the rowid of a row which is going to be updated by "update statement".

    check out v$session and the following columns.
    It is documented here
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch3171.htm#1122127
    ROW_WAIT_OBJ#
    NUMBER
    Object ID for the table containing the ROWID specified in ROW_WAIT_ROW#
    ROW_WAIT_FILE#
    NUMBER
    Identifier for the datafile containing the ROWID specified in ROW_WAIT_ROW#. This column is valid only if the session is currently waiting for another transaction to commit and the value of ROW_WAIT_OBJ# is not -1.
    ROW_WAIT_BLOCK#
    NUMBER
    Identifier for the block containing the ROWID specified in ROW_WAIT_ROW#. This column is valid only if the session is currently waiting for another transaction to commit and the value of ROW_WAIT_OBJ# is not -1.
    ROW_WAIT_ROW#
    NUMBER
    The current ROWID being locked. This column is valid only if the session is currently waiting for another transaction to commit and the value of ROW_WAIT_OBJ# is not -1.

  • How can I retain updates made in multiple locked rows and override scope rollback defined for row locking purposes ?

    I have a set of stored procedures in SQL
    One of which is called to build a list of entries to submit to a web service
    Those queries are called by identical processes running on different machines, so to prevent duplicate processing we lock rows that are presently being processed.
    BEGIN
    TRAN TRAN1
    SELECT t.[TransactionId],t.[ContentIdentifier]
    FROM [dbo].[Transactions]
    t WITH(READPAST,
    UPDLOCK,
    ROWLOCK)where
    (t.Quarantined
    <> 1)
    COMMIT
    A Second stored procedure simply updates the Quarantined flag.
    My C# code
    TransactionOptions transactionOptions
    =
    new
    TransactionOptions();
    transactionOptions.IsolationLevel
    =
    IsolationLevel.ReadCommitted;
    transactionOptions.Timeout
    =
    new
    TimeSpan(0,
    10,
    0);
    using (TransactionScope
    scopeMain =
    new
    TransactionScope(TransactionScopeOption.Required,
    transactionOptions))
    TransactionsReady = DAL.GetFilesForProcessingByServiceType(i);
    using (TransactionScope
    scopeSuppress =
    new
    TransactionScope(TransactionScopeOption.Suppress,
    transactionOptions))
    foreach (var
    Transaction in TransactionsReady)
    { try
    returnData = proxy.Submit(stuffToProcess);
    using (var
    scopeInner =
    new System.Transactions.TransactionScope())
    DAL.QuarantineTransaction(Transaction.TransactionId);
    scopeInner.Complete();
    scopeSuppress.Complete();
    scopeMain.Complete();
    The problem I experience is that if I have the Transaction Scope scopeSuppress uncommented, then the QuarantineTransaction stored procedure deadlocks.
    However if I comment out the ScopeSuppress, while the process then works, if it is interrupted mid-way, then all of the Quarantine flags get reset, meaning the entire batch of items will get re-submitted next
    pass (this is not desirable).
    What I actually want to occur, is for the Quarantine flag to be retained on all processed records so that even if the program terminates unexpectedly, processed items remain processed but all the row locks are
    released.
    Does anyone know of a way to achieve this ?

    The hour is late where I sit, so I don't have the time to dive into this in detail.
    However, if memory serves, TransactionScopes defaults to Serializable isolation level, which may explain the deadlocks you are getting.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • HT1212 Hi, one of my daughters friends tried to access her ipod causing it to become disabled; i do not want her to lose all her photos, she accesses my itunes account which is on ICLOUD, will she lose all her data - can this be fixed?

    Hi, one of my daughters friends tried to access her ipod causing it to become disabled; i do not want her to lose all her photos, she accesses my itunes account which is on ICLOUD, will she lose all her data - can this be fixed? I do not think it has been synced with a computer before.

    Disabled
    If you previously synced to the computer then you may be able to recover use of the iPod without erasing the iPod by following the instructions here:
    Disabled Recovery-must use syncing computer.
    Otherwise y will have to restore and thus erase the iPod
    You can restore from backup
    If not in backup then:
    - If you used PhotoStream then try getting them from your PhotoStream. See that topic of:
    iOS: Importing personal photos and videos from iOS devices to your computer
    - Maybe from the restored iPod via How to perform iPad recovery for photos, videos
    Wondershare Dr.Fone for iOS: iPhone Data Recovery - Wondershare Official     
    http://www.amacsoft.com/ipod-data-recovery.html
    -iPod touch Deleted Photo Recovery Tips You Should Know
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.
    If you previously synced to the computer then you may be able to recover use of the iPod without erasing the iPod by following the instructions here:
    Disabled Recovery-must use syncing computer.

  • How to find rowid of locked rows?

    Hello All,
    I have the "before update trigger" I want to know the rowid of all the locked row before update so that I dont try to update the same row which is locked by some other user. In Ask Tom forum I have seen how to know the rowid of locked row, but it will work only when Some body got hanged in that Perticular row while trying to update it. I dont want the User to get hanged, for that I want to user before update trigger. Help me.

    I believe this is a duplicate of another question in this forum
    How to find out rowid of locked row
    which I answered.
    Justin

  • How to find the LOCKED ROWS in a table?

    Not locked objects, but for a table the locked rows.

    Check below links :
    http://www.jlcomp.demon.co.uk/faq/locked_rows.html
    How to find the locked row.
    who are waiting for same record?
    HTH
    Girish Sharma

  • The requested object is locked by another transaction

    Hi All,
    I got a problem while loading data from an ODS to another ODS, it shows 450 records but request is red, it says
    'The requested object is locked by another transaction'
    Message no. MC602
    Diagnosis
    A lock requested by calling an ENQUEUE function module cannot be provided because the object in question has already been locked by its own transaction.
    Technical Information: The C_ENQUEUE routine returns the following values:
    COLLISION_OBJECT = ERSMONFACT
    COLLISION_UNAME = SINGH
    System response
    The ENQUEUE function module triggers an appropriate exception. If this exception was not intercepted by the application program, it leads automatically to the active SAP transaction being cancelled.
    Procedure
    Once the ENQUEUE function module is called, the application program should intercept this exception and react to it appropriately.
    I tried SM12 but there is no lock entry, can u suggest some thing?
    Regards,

    Hello,
    here your dso seems to be lock as some read and write opertaion is happening at the time u r running the dtp.
    Here two things to look :
    1.Check the error that ur getting while running a dtp the process monitor etc try to find the request id which has locked the dso . Copy that request id go to t-code RSRQ see whats this request who is user,target etc..contact user for cancelling the job if it has been stuck for long long time. Copy the JOB ID from  RSRQ for that rquest go to SM37 give the date as there in RSRQ and kill the job
    2.GO to SM12 try to search the object there and remove the lock.
    Thanks,
    Deepak

  • Error -2038: Record locked by another transaction / Internal error occured

    Hi, sometimes when I'm trying to update a SO via DI API, I got this error -2038. The error message varies, either: "Internal error occured" or "Record locked by another transaction". Ffor 'record locked' error, the table/field names varies, eg.
    [RDR1.ItemCode][line: 7]
    [RDR12.TaxId8][line: 1]
    [WTR1.ItemCode][line: 1]
    [RDR1.ItemCode][line: 9]
    [RDR1.ItemCode][line: 3]
    [RDR12.TaxId2][line: 1]
    [RDR12.CityS][line: 1]
    Any idea what the problem might be? FYI I'm using PL41, and this DI calls are from a centralized 'handler' VB.NET program. I've also released the instantiated BO objects via System.Runtime.InteropServices.Marshal.ReleaseComObject() (http://support.microsoft.com/kb/317109)
    Thanks.

    David: what do you mean by 'S-User for the Marketplace'? I think I'm not an S-User, so I still can't login... How can I be an S-User?
    Anyway, I'll close this question, even though it's not really solved. I can't find any other user updating the same document, but that -2038 errors still pop up.
    Currently I'm using John's approach to retry whenever I got -2038. As long as it works and everybody's happy I guess...
    Thanks everybody.

  • JBO-28004: Could not lock row in control table for table null

    hello.
    we have deployed two application on a server.
    both have code like this:
         select = "SELECT * from tab";
    vo = e.getDBTransaction().createViewObjectFromQueryStmt(select);
                        vo.executeQuery();
                        RowSet rs = vo.getRowSet();
                        if(rs != null)
                             Row lastRow = vo.getRowSet().last();
    the last line throws sometimes an exception (.last()).
    JBO-28004: Could not lock row in control table for table null
    at oracle.jbo.PCollException.throwException(PCollException.java:34)
    at oracle.jbo.pcoll.OraclePersistManager.commit(OraclePersistManager.java:229)
    at oracle.jbo.pcoll.OraclePersistManager.dropTable(OraclePersistManager.java:499)
    at oracle.jbo.pcoll.OraclePersistManager.createTable(OraclePersistManager.java:692)
    at oracle.jbo.pcoll.OraclePersistManager.insert(OraclePersistManager.java:1492)
    at oracle.jbo.pcoll.PCollNode.passivateElem(PCollNode.java:542)
    at oracle.jbo.pcoll.PCollNode.passivate(PCollNode.java:657)
    at oracle.jbo.pcoll.PCollection.passivateLRULeafNode(PCollection.java:351)
    at oracle.jbo.pcoll.PCollection.checkActiveLeafLimit(PCollection.java:404)
    at oracle.jbo.pcoll.PCollection.nodeRecentlyUsed(PCollection.java:252)
    at oracle.jbo.pcoll.PCollNode.<init>(PCollNode.java:73)
    at oracle.jbo.pcoll.PCollNode.checkForSplit(PCollNode.java:1553)
    at oracle.jbo.pcoll.PCollNode.addObject(PCollNode.java:1622)
    at oracle.jbo.pcoll.PCollNode.addObject(PCollNode.java:1610)
    at oracle.jbo.pcoll.PCollection.addElement(PCollection.java:753)
    at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:1247)
    at oracle.jbo.server.QueryCollection.getRowCount(QueryCollection.java:1065)
    at oracle.jbo.server.ViewRowSetImpl.getRowCount(ViewRowSetImpl.java:1444)
    at oracle.jbo.server.ViewRowSetIteratorImpl.last(ViewRowSetIteratorImpl.java:1183)
    at oracle.jbo.server.ViewRowSetImpl.last(ViewRowSetImpl.java:2246)
    at oracle.jbo.server.ViewObjectImpl.last(ViewObjectImpl.java:4352)
    at com.omv.emis.extemis.bc.EmsFreigabeImpl.checkFullMonth(EmsFreigabeImpl.java:327)
    at com.omv.emis.extemis.bc.EmsFreigabeImpl.doDML(EmsFreigabeImpl.java:293)
    at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:3410)
    at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2274)
    at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2216)
    at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1511)
    at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:1677)
    at EmsFreigabeView1_BrowseEdit._jspService(_EmsFreigabeView1__BrowseEdit.java:134)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:563)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:309)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    this exception does not occur every time just sometimes.
    (no other user/application uses the specific table, so there is no other lock)
    maybe someone knows an error source.
    thx in advance.

    Gina:
    Could you run you app with diagnostic turned on?
    If you're launching your middle tier from command prompt, you should invoke java as
    java -Djbo.debugoutput=console ...
    If you're launching your middle tier from w/i JDev..
    1. Select the project.
    2. Do right mouse click and select "Project Settings..."
    3. On the Settings dialog, select Configurations/Runner.
    4. In the righthand side pane, you should see a textbox for "Java
    Options". Please add the following JVM switch:
    -Djbo.debugoutput=console
    Then, rerun. The run command should include
    -Djbo.debugoutput=console as in
    "D:\JDev9i\jdk\bin\javaw.exe" -Djbo.debugoutput=console -classpath ...
    Then, you should see a lot of diagnostic messages. It will also give you complete stack trace including that of the detail exception.
    When you get the exception diagnostic output, please post that to this thread.
    Thanks.
    Sung

  • Who locks row in IOT?

    Hi,
    I have an index organized table (IOT) where I need to find the locking session for as certain row.
    I found usefull information on this website: http://www.orafaq.com/node/854
    But for some reason I annot use <tt>DBMS_ROWID.rowid_create</tt> to calculate rowid's in the IOT:    SQL> SELECT sid
          2    FROM v$lock
          3        JOIN dba_objects dbob
          4          ON (object_id = id1)
          5        JOIN v$session vds
          6          USING (sid)
          7          WHERE DBOB.OBJECT_NAME = 'PAC_ZUO_PARA_HEAD_TOP_IOT';
               SID
              2058
        SQL> SELECT to_char(DBMS_ROWID.rowid_create (1
          2                                ,  vds.row_wait_obj#
          3                                ,  vds.row_wait_file#
          4                                ,  vds.row_wait_block#
          5                                ,  vds.row_wait_row#
          6                                 ))
          7    FROM v$session vds
          8   WHERE     sid = 2058;
        SELECT to_char(DBMS_ROWID.rowid_create (1
        ERROR at line 1:
        ORA-01410: invalid ROWID
        ORA-06512: at "SYS.DBMS_ROWID", line 38
        SQL> SELECT 'rid '||rowid , zpht.*
          2    FROM  pac_zuo_para_head_top_iot zpht
          3   WHERE ZPHT.PARA_ID =   1845828150001; -- row locked by the other session
        'RID'||ROWID                                     PARA_ID TOP_PARA_ID
        rid *BAOSoyoIxwJVOx0QAQL+                     1.8458E+12  2.0797E+12
        SQL>How do I match the locked rows with the one I'm locking for?
    DB is 10.2.0.5 soon upgrading to 11.2.*
    *[edit]* waiting for a blocking lock and looking from a third session is not an option.
    bye
    TPD
    Edited by: T.PD on 01.03.2012 14:44

    I'm not sure how to answer your question, but IOTs don't use "regular" ROWIDs. They use "Logical" or "Universal" ROWIDs which DBMS_ROWID does not support.
    DBMS_ROWID is not to be used with universal ROWIDs (UROWIDs).Source: http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_rowid.htm#CIHJBJHG

  • Will restore profile suing FEBE cause prefs.js become read only?

    just encounter some issues related to prefs.js, and not sure why it become read only.
    only did restoration of profile using FEBE, will it cause prefs.js become read only?

    You can always check the read-only state of individual files if you suspect issues with files being read-only.
    You normally only get a read-only state for files if you backup (copy) files to a read-only medium (CD/DVD).

Maybe you are looking for