Table rows lock problem

Dear Oracle Tech.
As end user of Oracle Database, we seek advise from Oracle on the following issue :
Our business application is an OLTP system and currently we have an adhoc batch process that needs to be executed. This batch process mirrors a normal online user process in the way some tables are updated on the database. Our concern arises when our customer requested to run the batch process during normal office hours which actually is not the norm. We would like to have your opinion on running batch update process during normal office hours, are there issues of lock contention and risk of deadlock? We understand Oracle databases have lock mechanisms built into it but is there a risk of the deadlock situation arising if we do execute the batch process during normal office hours? And if deadlock does occurs, how easy is it to detect and resolve the deadlock and return the application to normal operation?
Our database is Oracle 7.3.4 running on Solaris 2.6 over a network, our online application is built with PowerBuilder 7 and running on Windows95 clients.
Thank You.

I have a related problem and thought that one of you might be able to help me. I am relatively new to JDBC.
My code is very similar to Alex' except that the queries are simpler (what does 'FOR UPDATE' do?).
con.setAutoCommit(false);
con.setTransactionIsolation( Connection.TRANSACTION_REPEATABLE_READ);
query1:
select * from table_bla where a=b
query2:
update table_bla set ... where a=b
The problem is that in between these 2 queries, the new rows get inserted into table_bla that satisfy a=b. Consequently, these rows get updated by query2, even though they haven't been retrieved by query1.
How do I synchronize this, so that nothing can be inserted into table_bla until my block of queries is executed (or how can I ensure that only the stuff that was retrieved by query1 is updated in the table)?
Help much appreciated.
Thanks!
Sladjana

Similar Messages

  • Table row lock problem

    Dear Oracle Tech.
    As end user of Oracle Database, we seek advise from Oracle on the following issue :
    Our business application is an OLTP system and currently we have an adhoc batch process that needs to be executed. This batch process mirrors a normal online user process in the way some tables are updated on the database. Our concern arises when our customer requested to run the batch process during normal office hours which actually is not the norm. We would like to have your opinion on running batch update process during normal office hours, are there issues of lock contention and risk of deadlock? We understand Oracle databases have lock mechanisms built into it but is there a risk of the deadlock situation arising if we do execute the batch process during normal office hours? And if deadlock does occurs, how easy is it to detect and resolve the deadlock and return the application to normal operation?
    Our database is Oracle 7.3.4 running on Solaris 2.6 over a network, our online application is built with PowerBuilder 7 and running on Windows95 clients.
    Thank You.

    Hi,
    fortunately Oracle tries by default to minimize all locking issues on its objects, only those rows are locked(until a commit or rollback occurs),which are modified by transactions, table locking will normally not happen. This is very appropriate and works well for OLTP applications. But, indeed, concurrent batch operations with bulk data loading could produce problems. In general, because of their resource consumption and also because of growing locking issues. Consider this example:
    You have (in your batch procedure) an update statement, which updates a complete table.
    UPDATE big_table SET field1 = anything;
    no WHERE clause reduces the affected rows.
    When this update has been started, all affected rows are locked, this may be many and the transaction will last for a long time, no other user can update (or delete) any of these rows. This issue is not resolved, until a commit or rollback occurs.
    Deadlocks are relatively rare and are selfdetected and resolved by oracle (the blocking transaction will be rollbacked). You will find an entry in the alert log and a trace file is produced.
    I'm not familiar with PowerBuilder, but I know sometimes Oracle's default locking methods are overwritten by third party software.
    Regards
    Werner

  • Table/row locking

    Hi Guys,
    Is this related to db size table/row locking?
    thanks
    version: 10.2.0.5
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    org.exolab.castor.jdo.LockNotGrantedException: persist.writeLockTimeoutcom

    dbaing wrote:
    Hi Guys,
    Is this related to db size table/row locking?
    thanks
    version: 10.2.0.5
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    org.exolab.castor.jdo.LockNotGrantedException: persist.writeLockTimeoutcomrow locking is 100% & totally independent of table size or number of rows in the table.
    java stack dump is borderline meaningless.
    You need Oracle error number & message to determine root cause.

  • Row locking problem

    Hello all
    My problem is : i cannot lock a rows in a table. I have checked and tried all the topics in all forums but no solutions yet. Here the code :
    con.setAutoCommit(false);
    con.setTransactionIsolation( Connection.TRANSACTION_REPEATABLE_READ);
    String sql = "SELECT * FROM TABLE WHERE .... FOR UPDATE'";
    Statement stmt1 = con.createStatement();
    stmt1.setCursorName("curs");
    rs = stmt1.executeQuery(sql);
    rs.next();
    String cursorName = rs.getCursorName();
    String sql2 = "UPDATE TABLE SET aaa = aaa WHERE CURRENT OF " + cursorName;
    Statement stmt2 = con.createStatement();
    int updateCount = stmt2.executeUpdate(sql2);
    My database is SQL SERVER 2000 and my Driver is JSQLConnect v3.
    Fistly SQL SERVER doesn't support "SELECT ..... FOR UPDATE"
    Secondly JSQLConnect doesn't support Statement.setCursorName() and Statement.getCursorName()
    Any one have any ideas to help me please. How can i lock a row in SQL SERVER, which driver allows me best for doing this
    Thank a millions times

    I have a related problem and thought that one of you might be able to help me. I am relatively new to JDBC.
    My code is very similar to Alex' except that the queries are simpler (what does 'FOR UPDATE' do?).
    con.setAutoCommit(false);
    con.setTransactionIsolation( Connection.TRANSACTION_REPEATABLE_READ);
    query1:
    select * from table_bla where a=b
    query2:
    update table_bla set ... where a=b
    The problem is that in between these 2 queries, the new rows get inserted into table_bla that satisfy a=b. Consequently, these rows get updated by query2, even though they haven't been retrieved by query1.
    How do I synchronize this, so that nothing can be inserted into table_bla until my block of queries is executed (or how can I ensure that only the stuff that was retrieved by query1 is updated in the table)?
    Help much appreciated.
    Thanks!
    Sladjana

  • Error: "... is not a table ..." XML not correctly interpreted after XSL-transformation. Table row quantity problem.

    Hey guys, this is one of my xml-elements:
    Jaspreet Sohi 12 18 Juliane Lenz 11 17 Sophie Charlotte Stender 10 15 Rosbeh Hamidzadeh Khayyat 12 17 Lion Stoldt 12 17 Mats Lucas Meincke 6 8 Bero Luke Vincent Ernst 6 8 Cedric Roth 6 8 Soner Cantay 6 8 The following XSL Transformation I use once for transforming all "m" tags and once in order to transform all "j" tags. Please imagine the CSL-code below to be duplicated exactly. Only the "jungs"-table-Tag is replaced by "mädchen" and all underscores _j are replace by _m. As well all "select="j[@..." parts are replaced by "select="m[@...". 1 2 3 The code is very easygoing I think and not difficult to understand. As I said, I use it twice - for both transformations. The very, extremely weird thing, my problem, is that one transformation works perfectly in InDesign and a table is created for all "kategorie"-tags (all is set within a for-each loop). But the second script does not work! I simply do not get this I can't understand it. I've tried more than anything. InDesign sais (in German, so translated based on assumption) "jungs is an invalid table element or is displayed in wrong order". The second strange thing is that I can replace my "aid:trows" attribute by any number, e.g. "10" and immediately the script works fine (as there are never more than 6 "j" tags in my XML so that never the table has more than 6 rows"). But it does not want to work correctly with the actual number, my variable "rows_j". These are my variables: They are all defined before the tables for m and j are created. So finally, why (the heck) is one table created and interpreted perfectly whereas the second - immediately following the first in the XSL.script as an EXACT copy of the first - results in an error? As i've already said, I've tried really everything. For example the script works also when one of the parts "" is randomly deleted from the script. Removing one of these parts directly makes the script working. Just one of my attempts to understand the thing but this has only shown that none of these parts "cell to end-for-each" includes an error. I'm really desperate and looking forward to being rescued by one of you geniuses :)

    Hah, No worries. The forum software is, well, different.
    What would be better, though, would be a sample ID file, any XSLT/XLT files you use, and a bit of data exactly as you have it (pre-transform state). ZIP it up, upload to say dropbox.com and feel free to send me a private message for the download link.
    Too many times there is something different between samples pasted into a post and the real thing that it is sometimes less useful time-wise. I'll keep it private, of course. Then we can communicate via PMs or email until we can (hopefully) arrive together at a solution, then post what that solution is in the forum to benefit others.
    Thank you, Mike

  • Table Row Frequent Lock

    Dear All,
    Recently we had changed our remote connection from 128KB Leased Line to high speed IP VPN (1MB) MPLS based lines. After that onwards Oracle table rows are getting locked frequently. We are using Windows 2003 Server Std with 9i 2.0.7 database loaded. Server Total Memory is 4GB with 3.2 MHz dual processor.
    When we increase the sga_max_size (1400MB or above), ORA-12500:TNS:Listener failed...... error appears and users can't connect to our database server.
    Memory Configuration is:-
    Shared Pool - 352MB
    Buffer Cache - 584MB
    Large Pool - 128MB
    Java Pool - 16MB
    SGA Max Size - 1281.573 MB
    Aggregate PGA Target - 259MB
    Please help to correctly calculate the Memory configuration if its wrong. Or is there any other solution to sort out the table row locking problem.
    Thanking you all in advance,
    Manesh

    On initial guess, it sounds like you are chasing the wrong aspect of the problem.
    You do not describe what the application is doing, but logically it appears that you are getting more transactions happening because of the higher access speed. In other words, the client is no longer being throttled back.
    You also do not decribe the actual kind of lock. It intrigues me that specific rows would need to be locked - that implies that the application is attempting to capture the rows ahead of time. This sort-of feels like the application may have been ported from another system, or designed based on a totally different locking machanism that what Oracle usess, forcing Oracle to try to work in a way it is not supposed to work.
    Simply throwing more resources at the problem will [probably] not solve the problem - it may alleviate it for a while. Better would be to understand what is actually happening and correct the root cause.
    I encourage you to read Tom Kyte's "Expert Oracle Database Architecture: 9i and 10g Programming Techniques and Solutions" to get some tools to help undertsnad and isolate the actual problem. (http://apress.com/book/bookDisplay.html?bID=10008)
    As for the ORA-12500, I believe Metalink has a few notes about that.

  • Locked table row

    I would like to identify the user who has a specific table row locked from another user who initiates a SELECT ... WHERE ROWID = ... FOR UPDATE ON ... NOWAIT. Is it possible to determine who has that lock?

    You can first select holding_session, waiting_session from dba_waiters.
    Using these find the username , osuser from v$session where sid=holding_session or
    sid=waiting_session
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by C. Fetter ([email protected]):
    I would like to identify the user who has a specific table row locked from another user who initiates a SELECT ... WHERE ROWID = ... FOR UPDATE ON ... NOWAIT. Is it possible to determine who has that lock?<HR></BLOCKQUOTE>
    null

  • Row lock contention problem on Inventory Management

    Hi
    My client is product based company and have e-Commerce (online Sale Order) application using Oracle database 10.2.0.5 & Web application deployed on WLS. Client have ~ 90 Warehouse country wide and ~ 200 Products (Items). Each product stock for each warehouse is maintained in Inventory Table (INV_BALANCE) which get updated for each order and their sale's products. We are using NO WAIT function to acquire lock on row to update stock balance. Last few months, client business is growing very fast and during Promotional Events (EXPO), they have sales of ~ 75K orders (~ 250K Items) within 2-3 days which start causing  row lock contention problem on INV_BALANCE table. We are seeing lots of "Row Lock Wait" and "enq: TX - row lock contention" event which cause ORA-00060: Deadlock detected and we need to eventually clear blocking sessions or everything just choked.
    select statistic_name,value from sys.v_$segment_statistics where object_name = 'INV_BALANCE'
    STATISTIC_NAME                                                                                                                        VALUE
    logical reads                                                                                                                                12423072
    buffer busy waits                                                                                                                           3895
    db block changes                                                                                                                         3516768
    physical reads                                                                                                                               957
    physical writes                                                                                                                            12197
    row lock waits                                                                                                                             49909
    space used                                                                                                                                -52921
    Deadlock graph:
                           ---------Blocker(s)--------  ---------Waiter(s)---------
    Resource Name          process session holds waits  process session holds waits
    TX-00880017-00002584       321    1675     X            110    1445           X
    TX-00b60008-00000741       110    1445     X            337    2158           X
    TX-0148000b-0000009e       337    2158     X            378    1525           X
    TX-01d50015-0000006f       378    1525     X            363    1842           X
    TX-02290012-00000070       363    1842     X            267    1798           X
    TX-024a0026-0000006e       267    1798     X            364    2084           X
    TX-020a0004-0000006f       364    2084     X            135    2113           X
    TX-01dc001f-00000070       135    2113     X            129    1586           X
    session 1675: DID 0001-0141-000001CA    session 1445: DID 0001-006E-00000202
    session 1445: DID 0001-006E-00000202    session 2158: DID 0001-0151-0000026B
    session 2158: DID 0001-0151-0000026B    session 1525: DID 0001-017A-00000167
    session 1525: DID 0001-017A-00000167    session 1842: DID 0001-016B-000002B4
    session 1842: DID 0001-016B-000002B4    session 1798: DID 0001-010B-000001F1
    Rows waited on:
    Session 1445: obj - rowid = 0001AE0E - AAAlK8AAHAAD7rMABY
      (dictionary objn - 110094, file - 7, block - 1030860, slot - 88)
    Session 2158: obj - rowid = 0001AE0E - AAAlK8AAHAAD7rMACD
      (dictionary objn - 110094, file - 7, block - 1030860, slot - 131)
    Session 1525: obj - rowid = 0001AE0E - AAAlK8AAHAAD7rOAB2
      (dictionary objn - 110094, file - 7, block - 1030862, slot - 118)
    Information on the OTHER waiting sessions:
    Session 1445:
      sid: 1445 ser: 37 audsid: 38316795 user: 69/<none>
                program: JDBC Thin Client
      application name: JDBC Thin Client, hash value=2546894660
      Current SQL Statement:
      SELECT ROWID, NVL(QTY_PEND,0)+NVL(:B3 ,0) FROM INV_BALANCE WHERE WHS_ID = :B2 AND STOCK_ID = :B1 FOR UPDATE OF QTY_PEND WAIT 10
    Please help me on following
    Q1: How can we reduce the "row lock Contention" on INV_BALANCE, all possible ways & best practices?
    Q2: How can we change the design to not have "row lock Contention" at all?
    Appreciate your help
    Thanks
    Amit Garg
    www.otnblogs.com

    Hi Amit!
    I saw you are using FOR UPDATE  in your query.
    If you  want reduce row locks, then you not must use FOR UPDATE.
    As you know, FOR UPDATE is locking rows.
    Regards
    Mahir M. Quluzade

  • Archive data of using DART : Job lock problem in table TSP01

    Hi ,
    I'm facing problem while archiving from Production system to UNIX using DART.
    Using TC: FTW1A to data extract, once data has extracted, we need to do verifaction progess through TC. FTWE1(run a BG jobRTXWCHK4) and FTWD(BG Job RTXWCHK2).
    When I am running TC: FTWD(BG Job RTXWCHK2)to verify, it was holding an extensive lock on the TSP01 table for long period of time which blocking others processing with this table, So We need to terminate this job. For the time being solution is to run this job during weekends.But I want solution for this.
    Is any boby can help me in this problem?
    Regards,
    Nupur S Jaipuriyar

    Locking a row that does not exist can be difficult.
    On most database you can lock an entire table through "LOCK TABLE <table>", however this may be extreme. Potentially you could also insert an empty row into the table with the id that you want to lock, then you would have a write lock on the row until you commit the transaction.

  • OIM DB Row LOCK Exception on Quartz tables

    I am facing db row lock error in Prod OIM due to which the Scheduler fails to kick off and an OIM Restart is required to release the lock and start the Scheduler again.
    This Error is occuring at any time when none of the scheduler( Custom as well as House Keeping) are scheduled.The OIM Version is 9.0.3.1.
    I have enabled Database logs in Debug mode but there are no logs corresponding to the table where lock occured.
    This Error was encountered long back with OIM 9.0.1 and was reported as Bug 6491465, but was suspended because of no response from Customer.
    The Error trace is as follows
    ERROR,11 Sep 2009 16:57:05,497,[org.quartz.core.ErrorLogger],An error occured while scanning for the next trigger to fire.
    org.quartz.impl.jdbcjobstore.LockException: Failure obtaining db row lock: Io exception: Connection reset [See nested exception: java.sql.SQLException: Io ex
    ception: Connection reset]
    at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.obtainLock(StdRowLockSemaphore.java:154)
    at org.quartz.impl.jdbcjobstore.JobStoreCMT.acquireNextTrigger(JobStoreCMT.java:1376)
    at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:231)
    * Nested Exception (Underlying Cause) ---------------
    java.sql.SQLException: Io exception: Connection reset
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:287)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:515)
    at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:1029)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1126)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3043)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
    at org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.obtainLock(StdRowLockSemaphore.java:137)
    at org.quartz.impl.jdbcjobstore.JobStoreCMT.acquireNextTrigger(JobStoreCMT.java:1376)
    at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:231)
    Did anyone had ever encountered this error.Any Hints?

    I would check the network pieces as suggested in our internal emails. If the connection is dropping somewhere on your network, the lock would never be released.
    -Kevin

  • Ajx problem with jsp .not able to show  ajax response data in table rows

    hi evryone
    i m new to ajax .i m not able solve this problem .pls help if anyone understood my problem
    probelm scenario is like this:
    take a example of shopping page where a field amount changes every time (time interval) ,the amount data is coming from database .ok...
    this i m trying to do with ajax and want to display the value in table rows one by one ..but response whihc i m getting is different .....same value is diaplying in evry rows .which i dont want
    the output it coming now is:like this
    item amount
    item 1 20
    item2 20
    item 3 20
    i want like thi s
    item amount
    item 1 20
    item2 30
    item 3 40
    even in database the value is 20,30,40
    here is the code of two jsp page
    one is ajaxitem_amount.jsp
    <%
    try
    stmt3 = con.createStatement();
    String itemQ="select item_ref_id,quantity from item_master where shop_ref_id="+shopid+" and (status is null or status<>'w') order by item_ref_id";
    //out.println(railQ);
    rs_details=stmt3.executeQuery(itemQ);
    while(rs_details.next())
    item2 = rs_details.getInt("ITEM_REF_ID");
    v.add(new Integer(item2));
    String aString = Integer.toString(item2);
    itemids.add(aString);
    Enumeration enum = v.elements();
    for (j=0; j<v.size(); j++)
    //out.println("v[" + j + "] = " + v.elementAt(j));
    sql3="select max(shop_amount) from shop_floor_temp where item_ref_id="+v.elementAt(j);
    rs_bid=stmt3.executeQuery(sql3);
    if(rs_price.next())
    last_price=rs_price.getDouble(1);
    if(last_price != 0)
    lprice= last_price;
    else
    lprice=1;
    out.print("<response>");
    out.print(lprice+"|");
    out.print("</response>");
    out.print("\n");
    catch(Exception ex)
    out.print("ERROR"+ex);
    // out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    _another is main shopping
    <td bgcolor="#C5B9AB" width="10%" align="center">
    <strong><font face="Verdana" size="2">Last price</font></strong>
    int tabrowcounter=0;
    while(rs_details.next())//some query
    tabrowcounter++;
    //*some more data is displayed here one by one all are working instead of this which i am calling from another page ajaxitem_amount.jsp page*
    <td bgcolor='<%=colorjava%>' width="50%" align="center">
    <div id="responseimage<%=tabrowcounter%>"></div>
    <div id="responseOutput<%=tabrowcounter%>"></div>
    <SCRIPT LANGUAGE="JavaScript">
    function createXHR<%=tabrowcounter%>()
    try { return new XMLHttpRequest(); } catch(e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
    try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
    alert("XMLHttpRequest not supported");
    return null;
    function sendRequest<%=tabrowcounter%>()
    document.getElementById('responseimage<%=tabrowcounter%>').innerHTML ="<IMG SRC='load.gif'> ";
    document.getElementById('responseimage<%=tabrowcounter%>').style.display = 'block';
    document.getElementById('responseOutput<%=tabrowcounter%>').style.display = 'none'
    var url="ajaxauct_floor.jsp";
    var xhr = createXHR<%=tabrowcounter%>();
    if (xhr)
    xhr.open("get",url,true);
    xhr.onreadystatechange = function()
    handleResponse<%=tabrowcounter%>(xhr);
    xhr.send(null);
    function handleResponse<%=tabrowcounter%>(xhr)
    if (xhr.readyState == 4 && xhr.status == 200)
    try
    var data = xhr.responseText.split("|");
    //document.write(data);
    //updatePage<%=tabrowcounter%>(xhr.responseText);
    //document.write(xhr.responseText);
    setTimeout('sendRequest<%=tabrowcounter%>()',10000);
    for(var x=0;x<data.length-1;x++)
    //alert(data);
    document.getElementById('responseOutput<%=tabrowcounter%>').innerHTML = data[x];
    document.getElementById('responseimage<%=tabrowcounter%>').style.display = 'none'; // HIDE
    document.getElementById('responseOutput<%=tabrowcounter%>').style.display = 'block'
    //document.getElementById('responseOutput<%=tabrowcounter%>').innerHTML = data[0];
    //document.getElementById('responseOutput<%=tabrowcounter%>').innerHTML = data[0];
    catch(e)
    alert('1 '+e)
    sendRequest<%=tabrowcounter%>();
    </SCRIPT>
    </td>
    </tr></table>
    if anyone have understood my problem pls help me .i have tried lot but not working .anyone genius here ?thnak you

    thanks baluc
    thanks for correcting me and giving me a good advice .anyway i m trying make you understand once again ...
    if you have understood this time please do reply .else i m sorry for placing wrong question ....
    hi everyone
    I m new to Ajax .I m not able solve this problem .pals help if anyone understood my problem
    problem scenario is like this:
    take a example of shopping page where a field amount changes every time (time interval) ,the amount field* (this data is coming from database )
    this I m trying to do with Ajax and want to display the value in table rows one by one ..But response which I m getting is different.....same value is displaying in every rows .which I don't want
    The output it coming now is: like this
    item amount
    item 1 20
    item2 20
    item 3 20
    I want like this s
    item amount
    item 1 20
    item2 30
    item 3 40
    even in database the value is 20,30,40
    here is the code of jsp page
    one page is ajaxitemamount.jsp_*
    <%
    try
    stmt3 = con.createStatement();
    String itemQ="select item_ref_id,quantity from item_master where shop_ref_id="+shopid+" and (status is null or status<>'w') order by item_ref_id";
    //out.println(railQ);
    rs_details=stmt3.executeQuery(itemQ);
    while(rs_details.next())
    item2 = rs_details.getInt("ITEM_REF_ID");
    v.add(new Integer(item2));
    String aString = Integer.toString(item2);
    itemids.add(aString);
    Enumeration enum = v.elements();
    for (j=0; j<v.size(); j++)
    //out.println("v[" + j + "] = " + v.elementAt(j));
    sql3="select max(shop_amount) from shop_floor_temp where item_ref_id="+v.elementAt(j);
    rs_bid=stmt3.executeQuery(sql3);
    if(rs_price.next())
    last_price=rs_price.getDouble(1);
    if(last_price != 0)
    lprice= last_price;
    else
    lprice=1;
    out.print("<response>");
    out.print(lprice+"|");
    out.print("</response>");
    out.print("\n");
    catch(Exception ex)
    out.print("ERROR"+ex);
    // out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    another is main shopping page page 2*
    <td bgcolor="#C5B9AB" width="10%" align="center">
    <strong><font face="Verdana" size="2">Last price</font></strong>
    int tabrowcounter=0;
    while(rs_details.next())//some query
    tabrowcounter++;
    <td bgcolor='<%=colorjava%>' width="50%" align="center">
    <div id="responseimage<%=tabrowcounter%>"></div>
    <div id="responseOutput<%=tabrowcounter%>"></div>
    <SCRIPT LANGUAGE="JavaScript">
    function createXHR<%=tabrowcounter%>()
    try { return new XMLHttpRequest(); } catch(e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
    try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
    alert("XMLHttpRequest not supported");
    return null;
    function sendRequest<%=tabrowcounter%>()
    document.getElementById('responseimage<%=tabrowcounter%>').innerHTML ="<IMG SRC='load.gif'> ";
    document.getElementById('responseimage<%=tabrowcounter%>').style.display = 'block';
    document.getElementById('responseOutput<%=tabrowcounter%>').style.display = 'none'
    var url="ajaxauct_floor.jsp";
    var xhr = createXHR<%=tabrowcounter%>();
    if (xhr)
    xhr.open("get",url,true);
    xhr.onreadystatechange = function()
    handleResponse<%=tabrowcounter%>(xhr);
    xhr.send(null);
    function handleResponse<%=tabrowcounter%>(xhr)
    if (xhr.readyState == 4 && xhr.status == 200)
    try
    var data = xhr.responseText.split("|");
    //document.write(data);
    //updatePage<%=tabrowcounter%>(xhr.responseText);
    //document.write(xhr.responseText);
    setTimeout('sendRequest<%=tabrowcounter%>()',10000);
    for(var x=0;x<data.length-1;x++)
    //alert(data);
    document.getElementById('responseOutput<%=tabrowcounter%>').innerHTML = data[x];
    document.getElementById('responseimage<%=tabrowcounter%>').style.display = 'none'; // HIDE
    document.getElementById('responseOutput<%=tabrowcounter%>').style.display = 'block'
    //document.getElementById('responseOutput<%=tabrowcounter%>').innerHTML = data[0];
    //document.getElementById('responseOutput<%=tabrowcounter%>').innerHTML = data[0];
    catch(e)
    alert('1 '+e)
    sendRequest<%=tabrowcounter%>();
    </SCRIPT>
    </td>
    </tr></table>
    if anyone have understood my problem please help me .i have tried lot but not working .anyone genius here ?thank you

  • Row locking issue with version enabled tables

    I've been testing the effect of locking in version enabled tables in order to assess workspace manager restrictions when updating records in different workspaces and I have encountered a locking problem where I can't seem to update different records of the same table in different sessions if these same records have been previously updated & committed in another workspace.
    I'm running the tests on 11.2.0.3.  I have ROW_LEVEL_LOCKING set to ON.
    Here's a simple test case (I have many other test cases which fail as well but understanding why this one causes a locking problem will help me understand the results from my other test cases):
    --Change tablespace names as required
    create table t1 (id varchar2(36) not null, name varchar2(50) not null) tablespace XXX;
    alter table t1 add constraint t1_pk primary key (id) using index tablespace XXX;
    exec dbms_wm.gotoworkspace('LIVE');
    insert into t1 values ('1', 'name1');
    insert into t1 values ('2', 'name2');
    insert into t1 values ('3', 'name3');
    commit;
    exec dbms_wm.enableversioning('t1');
    exec dbms_wm.gotoworkspace('LIVE');
    exec dbms_wm.createworkspace('TESTWSM1');
    exec dbms_wm.gotoworkspace('TESTWSM1');
    --update 2 records in a non-LIVE workspace in preparation for updating in different workspaces later
    update t1 set name = name||'changed' where id in ('1', '2');
    commit;
    quit;
    --Now in a separate session (called session 1 for this example) run the following without committing the changes:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --Now in another session (session 2) update a different record from the same table.  The below update will hang waiting on the transaction in session 1 to complete (via commit/rollback):
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    I'm surprised records of different ids can't be updated in different sessions i.e. why does session 1 lock the update of record 2 which is not being updated anywhere else.  I've tried this using different non-LIVE workspaces with similar results.  I've tried changing table properties e.g. initrans with and still get a lock.  The changes to table properties are successfully propagated to the _LT tables but not all the related workspace manager tables created for table T1 above.  I'm not sure if this is the issue.
    Note an example of the background workspace manager query that may create the lock is something like:
    UPDATE TESTWSM.T1_LT SET LTLOCK = WMSYS.LT_CTX_PKG.CHECKNGETLOCK(:B6 , LTLOCK, NEXTVER, :B3 , 0,'UPDATE', VERSION, DELSTATUS, :B5 ), NEXTVER = WMSYS.LT_CTX_PKG.GETNEXTVER(NEXTVER,:B4 ,VERSION,:B3 ,:B2 ,683) WHERE ROWID = :B1
    Any help with this will be appreciated.  Thanks in advance.

    Hi Ben,
    Thanks for your quick response.
    I've tested your suggestion and it does work with 2 workspaces but the same problem is enountered when additional workspaces are created. 
    It seems if multiple workspaces are used in a multi user environment, locks will be inevitable which will degrade performance especially if a long transaction is used. 
    Deadlocks can also be encountered where eventually one of the sessions is rolled back by the database. 
    Is there a way of avoiding this e.g. by controlling the creation of workspaces and table updates?
    I've updated my test case below to demonstrate the extra workspace locking issue.
    --change tablespace name as required
    create table t1 (id varchar2(36) not null, name varchar2(50) not null) tablespace XXX;
    alter table t1 add constraint t1_pk primary key (id) using index tablespace XXX;
    exec dbms_wm.gotoworkspace('LIVE');
    insert into t1 values ('1', 'name1');
    insert into t1 values ('2', 'name2');
    insert into t1 values ('3', 'name3');
    commit;
    exec dbms_wm.enableversioning('t1');
    exec dbms_wm.gotoworkspace('LIVE');
    exec dbms_wm.createworkspace('TESTWSM1');
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = name||'changed' where id in ('1', '2');
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    --end of original test case, start of additional workspace locking issue:
    Session 1:
    rollback;
    Session 2:
    rollback;
    --update record in both workspaces
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '3';
    commit;
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    exec dbms_wm.gotoworkspace('LIVE');
    exec dbms_wm.createworkspace('TESTWSM2');
    exec dbms_wm.gotoworkspace('TESTWSM2');
    update t1 set name = name||'changed2' where id in ('1', '2');
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this now gets locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --update record 3 in TESTWSM2
    exec dbms_wm.gotoworkspace('TESTWSM2');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --try updating LIVE
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --try updating TESTWSM1 workspace too - so all have been updated since TESTWSM2 was created
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = 'changed' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;
    --try updating every workspace afresh
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changedA' where id = '3';
    commit;
    exec dbms_wm.gotoworkspace('TESTWSM1');
    update t1 set name = 'changedB' where id = '3';
    commit;
    exec dbms_wm.gotoworkspace('TESTWSM2');
    update t1 set name = 'changedC' where id = '3';
    commit;
    Session 1:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '1';
    --this is still locked out by session 1
    session 2:
    exec dbms_wm.gotoworkspace('LIVE');
    update t1 set name = 'changed' where id = '2';
    Session 1:
    rollback;
    Session 2:
    rollback;

  • Enq: TX - row lock contention problem

    Hi ,
    Db version 10.2.0.4
    os solaris.
    i have upgraded my database from 9.2.0.4 to 10.2.0.4 by using exp/imp as my database is small.
    I have created new instance of 10g and changed parameter values as 9i(as required). then imported from 9i to 10g instance.
    After importing in 10g instance we are face application wide performance problem..the response time of the applicatoin was very slow...
    i have taken awr report of various times and have seeen
    SELECT puid,ptimestamp FROM PPOM_OBJECT WHERE puid IN (:1) FOR UPDATE
    this query is causing the problem..enq: TX - row lock contention
    Cache Sizes
    ~~~~~~~~~~~                       Begin        End
                   Buffer Cache:       756M       756M  Std Block Size:         8K
               Shared Pool Size:       252M       252M      Log Buffer:     1,264K
    Load Profile
    ~~~~~~~~~~~~                            Per Second       Per Transaction
                      Redo size:              2,501.54              3,029.25
                  Logical reads:              2,067.79              2,504.00
                  Block changes:                 17.99                 21.78
                 Physical reads:                  0.02                  0.03
                Physical writes:                  0.41                  0.50
                     User calls:                140.74                170.44
                         Parses:                139.55                168.99
                    Hard parses:                  0.01                  0.01
                          Sorts:                 10.65                 12.89
                         Logons:                  0.32                  0.38
                       Executes:                139.76                169.24
                   Transactions:                  0.83
      % Blocks changed per Read:    0.87    Recursive Call %:    17.60
    Rollback per transaction %:    0.00       Rows per Sort:    16.86
    Instance Efficiency Percentages (Target 100%)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                Buffer Nowait %:  100.00       Redo NoWait %:  100.00
                Buffer  Hit   %:  100.00    In-memory Sort %:  100.00
                Library Hit   %:  100.03        Soft Parse %:  100.00
             Execute to Parse %:    0.15         Latch Hit %:   99.89
    Parse CPU to Parse Elapsd %:   93.19     % Non-Parse CPU:   94.94
    Shared Pool Statistics        Begin    End
                 Memory Usage %:   86.73   86.55
        % SQL with executions>1:   90.99   95.33
      % Memory for SQL w/exec>1:   79.15   90.58
    Top 5 Timed Events                                         Avg %Total
    ~~~~~~~~~~~~~~~~~~                                        wait   Call
    Event                                 Waits    Time (s)   (ms)   Time Wait Class
    CPU time                                            397          86.3
    enq: TX - row lock contention           508          59    115   12.7 Applicatio
    log file sync                         2,991           5      2    1.1     Commit
    log file parallel write               3,238           5      2    1.1 System I/O
    SQL*Net more data to client          59,871           4      0    1.0    Network
    ^LTime Model Statistics              DB/Inst: WGMUGPR2/wgmugpr2  Snaps: 706-707
    -> Total time in database user-calls (DB Time): 460.5s
    -> Statistics including the word "background" measure background process
       time, and so do not contribute to the DB time statistic
    -> Ordered by % or DB time desc, Statistic name
                                                                       Avg
                                                 %Time  Total Wait    wait     Waits
    Event                                 Waits  -outs    Time (s)    (ms)      /txn
    enq: TX - row lock contentio            508     .0          59     115       0.2
    log file sync                         2,991     .0           5       2       1.0
    log file parallel write               3,238     .0           5       2       1.1
    SQL*Net more data to client          59,871     .0           4       0      20.1
    control file parallel write           1,201     .0           1       1       0.4
    SQL*Net more data from clien          3,393     .0           1       0       1.1
    SQL*Net message to client           509,864     .0           1       0     170.9
    os thread startup                         3     .0           1     196       0.0
    db file parallel write                  845     .0           1       1       0.3
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
      Elapsed      CPU                  Elap per  % Total
      Time (s)   Time (s)  Executions   Exec (s)  DB Time    SQL Id
            59          1        1,377        0.0    12.9 bwnt27fp0z3gm
    Module: syncdizio_op@snstr09 (TNS V1-V3)
    SELECT puid,ptimestamp FROM PPOM_OBJECT WHERE puid IN (:1) FOR UPDATE
            41         41          459        0.1     8.9 8cdswsp7cva2h
    Module: syncdizio_op@snstr09 (TNS V1-V3)
    select rpad(argument_name, 32, ' ') || in_out || ' ' || nvl(type_subname, data_t
    ype) info from user_arguments where package_name IS NULL and object_name = uppe
    r(:1) and argument_name is not null order by object_name, position
            39         38        7,457        0.0     8.4 271hn6sgra2d8
    Module: syncdizio_op@snstr09 (TNS V1-V3)
    SELECT DISTINCT t_0.puid FROM PIMANTYPE t_0 WHERE (UPPER(t_0.ptype_name) = UPPER
    (:1))
            23         22          459        0.0     4.9 g92t08k78tgrw
    Module: syncdizio_op@snstr09 (TNS V1-V3)
    SELECT PIMANTYPE.puid, ptimestamp, ppid, rowning_siteu, rowning_sitec, pis_froze
    n, ptype_class, ptype_name FROM PPOM_OBJECT, PIMANTYPE WHERE PPOM_OBJECT.puid =
    (PIMANTYPE.puid)
            22         22      158,004        0.0     4.9 chqpmv9c05ghq
    Module: syncdizio_op@snstr09 (TNS V1-V3)
    SELECT puid,ptimestamp FROM PPOM_OBJECT WHERE puid = :1
            17         17        2,294        0.0     3.7 3n5trh11n1x8w
    Module: syncdizio_op@snstr09 (TNS V1-V3)
    SELECT PTYPECANNEDMETHOD.puid, ptimestamp, ppid, rowning_siteu, rowning_sitec, p
    is_frozen, pobject_desc, psecure_bits,VLA_344_5, pmethod_name, pmsg_name, ptype_
    name, pexec_seq, paction_type FROM PPOM_OBJECT,PBUSINESSRULE, PTYPECANNEDMETHOD
    WHERE PTYPECANNEDMETHOD.puid IN (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,in 9i there is a parameter ENQUEUE_RESOURCES but in 10g relese 2 its got obsoleted....
    am new to performace tunning please advice me....!
    Regards
    Vamshi

    The CBO has changed substantially between 9.2.x and 10.2.x. Pl see MOS Doc 754931.1 (Cost Based Optimizer - Common Misconceptions and Issues - 10g and Above). Pl verify that statistics have been gathered and are current - pl see MOS Doc 605439.1 (Master Note: Recommendations for Gathering Optimizer Statistics on 10g).
    Looking at your output, it seems to me that the database is entirely CPU-bound. 86.3% of time is spent on CPU. The last 5 SQL statements in the output, all of the elapsed time is spent on CPU.
    Pl post your init.ora parameters, along with your hardware specs. This question might be more appropriate in the "Database - General" forum.
    HTH
    Srini

  • Problems with the table of lock is fills

    Hello all
    In my system in occasions repeated, the table of lock it is fills
    Per this problem, I did open the message with SAP and in this message the sap support, I replied that increase the  parameter value  "enque/table_size" at 200 MB, this is the value for 200 MB (202752)
    With the parameters implemented in my system, the table of lock to a is fills, this is not resolved my problem and continuos.
    Other comment is that the value maximun is 200 MB for this lock table.
    I think the problem is in the programs that executed this lock, when is executed some programs that sent the information at my stores, is when the lock table fills.

    Thaks for you answer
    Already enters in the transaction SM12 and see the registers in this table
    with this information, I found the users that added lock in the system and the system table the which is locked.
    But with this information, how can know few registers are locked per users in the SM12 and top file and history alone display this information
    300  PRODUCCION1  30.11.2010  U 11/30  Nr_of_Locks:    4960  Scope:  2   0     4,960
    300  PRODUCCION    30.11.2010  U 11/30 Nr_of_Locks:     5000  Scope:  2   0     5,000
    300  PRODUCCION1   30.11.2010  U 11/30 Nr_of_Locks:     4918  Scope:  2   0     4,918
    300  PRODUCCION1   30.11.2010  U 11/30 Nr_of_Locks:     4956  Scope:  2   0     4,956
    300  PRODUCCION     30.11.2010  U 11/30 Nr_of_Locks:     5020  Scope:  2   0     5,020
    300  PRODUCCION1   01.12.2010  U  12/01 Nr_of_Locks:     4911  Scope:  2  0     4,911
    300  PRODUCCION1  01.12.2010  U  12/01 Nr_of_Locks:     5014  Scope:  2  0     5,014
    300  PRODUCCION1   01.12.2010  U  12/01 Nr_of_Locks:     4939  Scope:  2 0     4,939
    300  PRODUCCION1   01.12.2010  U  12/01 Nr_of_Locks:      190  Scope:  1 0      190     
    300  PRODUCCION1   01.12.2010   U  12/01 Nr_of_Locks:      191  Scope:  2 0     191
    300  PRODUCCION1   01.12.2010   U  12/01 Nr_of_Locks:     4775  Scope:  2 0     4,775
    300  PRODUCCION1   01.12.2010   U  12/01 Nr_of_Locks:     5022  Scope:  2 0     5,022
    For my is important know which is the number of locks of this user,this I would give me an idea more clear the problem.

  • Identifying deadlocked resources in graph with 1 row lock and 1 table lock

    Hi, I have run into repeated occurrences of the deadlock graph at the bottom of this post and have a few questions about it:
    1. It appears that proc 44, session 548 is holding a row lock (X). Is the waiter, proc 30, session 542, trying to acquire a row lock (X) also or an exclusive table lock (X) on the table containing that row?
    2. Under what circumstances would something hold a row exclusive table lock (SX) and want to upgrade that to a share row exclusive table lock (SSX)?
    3. Our table cxml_foldercontent has a column 'structuredDataId' with a FK to cxml_structureddata.id and an ON DELETE SET NULL trigger. Would this help explain why an "update" to one table (i.e.g cxml_foldercontent) would also need to acquire a lock in a foreign table, cxml_structureddata?
    4. What is the difference between "Current SQL statement:" and "Current SQL statement for this session:"? That terminology is confusing. Is session 542 executing the "update" or the "delete"?
    5. In the "Rows waited on:" section is it saying that Session 542 is waiting on on obj - rowid = 0000BE63 - AAAL5jAAGAAA6tZAAK or that it is has the lock on that row and other things are waiting on it?
    A couple of notes:
    - the cxml_foldercontent.structuredDataId FK column has an index on it already
    Deadlock graph:
                           ---------Blocker(s)--------  ---------Waiter(s)---------
    Resource Name                    process session holds waits  process session holds waits
    TX-003a0011-000003d0        44       548     X               30        542             X
    TM-0000be63-00000000       30       542     SX              44        548     SX    SSX
    session 548: DID 0001-002C-000002D9     session 542: DID 0001-001E-00000050
    session 542: DID 0001-001E-00000050     session 548: DID 0001-002C-000002D9
    Rows waited on:
    Session 542: obj - rowid = 0000BE63 - AAAL5jAAGAAA6tZAAK
      (dictionary objn - 48739, file - 6, block - 240473, slot - 10)
    Session 548: no row
    Information on the OTHER waiting sessions:
    Session 542:
      pid=30 serial=63708 audsid=143708731 user: 41/CASCADE
      O/S info: user: cascade, term: unknown, ospid: 1234, machine:
                program: JDBC Thin Client
      application name: JDBC Thin Client, hash value=2546894660
      Current SQL Statement:
    update cascade.cxml_foldercontent set name=:1 , lockId=:2 , isCurrentVersion=:3 , versionDate=:4 , metadataId=:5 , permissionsId=:6 , workflowId=:7 , isWorkingCopy=:8 , parentFolderId=:9 , relativeOrder=:10 , cachePath=:11 , isRecycled=:12 , recycleRecordId=:13 , workflowComment=:14 , draftUserId=:15 , siteId=:16 , prevVersionId=:17 , nextVersionId=:18 , originalCopyId=:19 , workingCopyId=:20 , displayName=:21 , title=:22 , summary=:23 , teaser=:24 , keywords=:25 , description=:26 , author=:27 , startDate=:28 , endDate=:29 , reviewDate=:30 , metadataSetId=:31 , expirationNoticeSent=:32 , firstExpirationWarningSent=:33 , secondExpirationWarningSent=:34 , expirationFolderId=:35 , maintainAbsoluteLinks=:36 , xmlId=:37 , structuredDataDefinitionId=:38 , pageConfigurationSetId=:39 , pageDefaultConfigurationId=:40 , structuredDataId=:41 , pageStructuredDataVersion=:42 , shouldBeIndexed=:43 , shouldBePublished=:44 , lastDatePublished=:45 , lastPublishedBy=:46 , draftOriginalId=:47 , contentTypeId=:48  where id=:49
    End of information on OTHER waiting sessions.
    Current SQL statement for this session:
    delete from cascade.cxml_structureddata where id=:1

    Mohamed Houri wrote:
    What is important for a foreign key is to be indexed (of course if the parent table is deleted/merged/updated, or if a performance reason imposes it). Wether this index is unique or not doesn't matter (as far as i know).But, you should ask your self the following question : what is the meaning of having a 1 to 1 relationship between a parent and a child table ? if you succeed to create a unique index on your FK then this means that for each PK value corresponds at most one FK value!! Isn't it? is this what you want to have?Thanks, as I mentioned above, cxml_structureddata is actually the child table of cxml_foldercontent with 1 or more records' owningEntityId referring to rows in cxml_foldercontent. The reason for the FK on cxml_foldercontent.structuredDataId is a little ambiguous but it explained above.
    Will a TX-enqueue held on mode X always be waited on by another TX-enqueue row lock X? Or can it be waited on by an Exclusive (X) table lock?Not really clear. Sorry, are you saying my question is unclear or it's not clear why type of eXclusive lock session 542 is trying to acquire in the first line of the trace? Do you think that the exclusive lock being held by session 548 in the first line is on rows in cxml_foldercontent (due to the ON DELETE SET NULL on these child rows) or rows in the cxml_structureddata that it's actually deleting?
    Is there any way for me to tell for certain?
    The first enqueue is a TX (Transaction Enqueue) held by session 548 on mode X (exclusive). This session represents the blocking session. At the same time the locked row is waited on by the blocked session (542) and the wait is on mode X (exclusive). So put it simply, we have here session 542 waiting for session 548 to release it lock (may be by commiting/roll backing). At this step we are not in presence of a deadlock.
    The second line of the deadlock graph shows that session 542 is the blocking session and it is doing a TM enqueue (DML lock) held on SX(Shared eXclusive). While session 548(which is the waiting session) is blocked by session 542 and is waiting on SSX mode.
    Here we see that 548 is blocking session 542 via a TX enqueue and session 542 is blocking session 548 via a TM enqueue ---> That is the deadlock. Oracle will then immediately choose arbitrarlly a victim session (542 or 548) and kill its process letting the remaining session continuing its work.
    That is your situation explained here.Thanks, any idea why session 542 (the DELETE from cxml_structureddata) would be trying to upgrade it's lock to SSX? Is this lock mode required to update a child tables foreign key columns when using an ON DELETE SET NULL trigger? Having read more about SSX, I'm not sure I understand in what cases it's used. Is there a way for me to confirm with 100% certainty specifically which tables in the TM enqueue locks are being held on? Is session 548 definitely trying to acquire an SSX mode on my cxml_foldecontent table or could it be cxml_structureddata table?
    (a) Verify that all your FK are indexed (be carreful that the FK columns should be at the leading edge of the index)Thanks, we've done this already. When you say the "leading edge" you mean for a composite index? These indexes are all single column.
    (b) Verify the logic of the DML against cxml_foldercontentCan you be more specific? Any idea what I'm looking for?

Maybe you are looking for