Kodo changes commit order in multithreaded scenario,resulting in DBdeadlock

We are currently using KODO version 3.4.1 as indicated by kodo-jdo-runtime-3.4.1.jar and kodo-jdo-3.4.1.jar. This is what is currently happening to our application in a scenario where multiple threads are trying to access the same set of tables. It results in a Oracle DB deadlock for one of the threads transactions. If kodo commits all the DB transactions in the same order as we had set in a particular transaction for each thread,then this deadlock wont occur, but what I noticed is that KODO changes the order in which the commit happens on the tables. Any help will be appreciated.

I have a simple example below which will illustrate actually what is happening which is resulting in a Oracle DB deadlock.
There are more that 4-5 tables that are being updated before a commit can happen.
Consider the following scenario
kodoPersistenceManager.makePersistent(table 1);
kodoPersistenceManager.makePersistent(table 2);
kodoPersistenceManager.makePersistent(table 3);
kodoPersistenceManager.makePersistent(table 4);
kodoPersistenceManager.makePersistent(table 5);
persistenceManager.close();
where persistenceManager is an instance of KodoPersistenceManager and
kodoPersistenceManager is also an instance of KodoPersistenceManager.
When multiple threads are trying to do the same operation which involves the same 6 statements as above being called, based on SQL trace thrown out by kodo I realised that kodo changes the commit order to something as shown below.
kodoPersistenceManager.makePersistent(table 2);
kodoPersistenceManager.makePersistent(table 3);
kodoPersistenceManager.makePersistent(table 1);
kodoPersistenceManager.makePersistent(table 4);
kodoPersistenceManager.makePersistent(table 5);
persistenceManager.close();
This results in a DB deadlock in the oracle database which rolls back the above transaction. There is a dependency that tables must be persisted in order table 1,table 2,table 3,table 4,table 5,table 6.
Any idea how this can be avoided? Thanks in advanvce

Similar Messages

  • BAPI_POSRVAPS_CREATESNPORDER to change existing order

    Hi Experts,
    I am using the following code to change the Deployment results - Confirmed Stock Transfer Requisition (EG and EF).
    After SNP heuristics run, the standard SAP deployment run happens. Then, a stock transport order with reference to production order is created without reference to stock transport requisition or confirmed stock transfer requisition. So, to consume or reduce this confirmed STR quantity, I am using the following code. But the issue is, the date of the confirmed stock transfer requisition gets changed after this BAPI FM. I don't want the date to be changed. Does anyone have any idea of how to just change the quantity, but not to change the dates?
    CALL FUNCTION 'BAPI_POSRVAPS_CREATESNPORDER'
    EXPORTING
    logical_system         = 'SAPXXX113'    " My current SAP APO system
    APPLICATION            = 'DEP'        " Changing Deployment orders
    EXT_NUMBER_ASSIGNMENT  = ' '        " I use ORDERID, instead of the order
    COMMIT_CONTROL         = 'E'        " Commit only on successful completion
    PLNG_VERSION           = '000'        " Active planning version
    change_if_exists       = 'X'        " If it exists, then change the same. If not create it.
    EVENT_CONTROL          = '1'        " To update the ERP system too
    CHECK_SOURCE_EXISTENCE = 'X' "To check and return error if the source doesn't exist
    TABLES
    order_data             = lt_order_data    " Data to be updated
    return                 = lt_return.    " Return message of BAPI update
    For filling the internal table lt_order_data, I am using the function module BAPI_POSRVAPS_GETLIST3.
    * Update fields for BAPI Update
    ls_order_data-ordid         = ls_requirements-ordid.        " ORDID from BAPI_POSRVAPS_GETLIST3
    ls_order_data-schedid       = ls_requirements-schedid.        " SCHEDID from BAPI_POSRVAPS_GETLIST3
    ls_order_data-order_number  = ls_requirements-order_number.    " Order number from BAPI_POSRVAPS_GETLIST3
    ls_order_data-product       = '4280143180'.            " Part number from BAPI_POSRVAPS_GETLIST3
    ls_order_data-location_from = 'HGKG'.                   " From Location number from BAPI_POSRVAPS_GETLIST3
    ls_order_data-loctype_from  = '1001'.                     " From location type from BAPI_POSRVAPS_GETLIST3
    ls_order_data-location_to   = 'SGPR'.                    " To location number from BAPI_POSRVAPS_GETLIST3
    ls_order_data-loctype_to    = '1001'.                      " To location type from BAPI_POSRVAPS_GETLIST3
    ls_order_data-ttype         = ls_receipts-ttype.         " TTYPE from BAPI_POSRVAPS_GETLIST3
    ls_order_data-unitofmeas    = ls_requirements-unitofmeas.
    ls_order_data-unitofmeas_iso = ls_requirements-unitofmeas.
    ls_order_data-order_start_date = ls_requirements-requirement_date. "What date to use here? Whatever the date I give it changes the already existing date. I don't want the dates to be changed
    ls_order_data-order_end_date   = ls_requirements-requirement_date.
    ls_order_data-fixed             = ls_requirements-fixed.
    clear: ls_order_data-atpcat_from, ls_order_data-atpcat_to, ls_order_data-trans_priority.
    Thanks,
    Suresh

    Hi Suresh,
    I have just come across your query. For your knowledge, I wanted you to know that the bapi 'BAPI_POSRVAPS_CREATESNPORDER' can still be used for your purpose i.e changing the Deployment STR Confirmed  Qty without changing Order Dates.
    To acheive this,
    1) Pass 'SNP' in the application parameter in the bapi 'BAPI_POSRVAPS_CREATESNPORDER'.
    2) Pass the order dates from the bapi 'BAPI_POSRVAPS_GETLIST3', which you wanted to retain, to 'Order_start_date','Order_end_date',of bapi 'BAPI_POSRVAPS_CREATESNPORDER' but with different quantity.
    3) However,i suggest you to not to pass ATPCAT_FROM and ATPCAT_TO fields to ORDER_DATA in the bapi 'BAPI_POSRVAPS_CREATESNPORDER'. I found this during debugging the bapi as it is repeatedly failing to update the deployed STR(Confirmed).
    Please find attached screenshot of ORDER_DATA structure for your reference.
    try these. It does work!!
    Thank you,
    Santosh KB.

  • I copied a smart playlist to a regular playlist in order to change the order of the individual selections.  I then burned the regular playlist to a cd, but the cd burned it in alphabetical order as it appears on the smart playlist.

    I changed the order, then burned a cd but the cd copied the songs in the order of the smart playlist, which was alphabetical.  What am i doing wrong in this scenario, and is there a way to change the song order in a smart playlist?  I am a new MAC user.  Is this unique to the MAC format?

    I'm trying to figure out a way to make a playlist of songs I generally like from a very large library to fit on my iPod. The songs aren't rated, and I don't want to have a totally random selection chosen by a smart playlist.
    I usually make two playlists.
    One playlist with favorites I do want on the iPod and another smart playlist to fill the rest of the iPod. Just limit the size to th esize of the iPod minus wthe size of my iPod selection playlist.

  • Change the order of boxes in different media queries

    How can I change the order of boxes in different media queries?
    Is the only work around to copy one box to the other order position and switch the Display attribute in the different media queries?

    Hi, thanks for your question. Reflow follows the rules of CSS and HTML. There is not a way to swap or move objects in the DOM without using something like Javascript. We've avoided that, and only focus on CSS and HTML with Reflow.
    Yes, you can use multiple boxes in different places and change their display as needed. But I might caution against doing this as it may add work for both you and anyone else that may take this design and put it into production. I might take a look at why you want to move the boxes around, and maybe find a simpler or more efficient design pattern to follow to get a result you would be happy with. Hope that doesn't sound preachy, you should try it if you want and don't listen to me. Either way, let me know how it goes!

  • Inbound Idoc Create/Change Purchase Order

    Hi All,
    I have to do a inbound Idoc scenario for create as well as change Purchase Order.
    Which is the IDoc type for Create/Change purchase order.
    I went through this form found that ORDERS05 can be used but I am not sure this can be used for both create as well change Purchase Order.
    If ORDERS05 can be used then which is Process code,Function Module and Message type for both create and change Purchase order.
    I also found that IDoc type PORDCR102 can be used for  create Purchase order and PORDCH02 can be used for change Purchase order,but i don't want to use two Idoc types.
    Please suggest.
    Thanks in advance.
    Regards,
    John

    Hi John,
    For creating a IDoc for PO, whenever a PO is created/Changed, it has to be configured in Parter Profile(WE20) for a particular Partner in Outbound Paramtrs tab.
    Give ORDERS05 in Message Type and select the line & go to Display.
    In the screen which appears , choose tab Message Control and give the Process code
    ME10 - Creation of PO
    ME11 - Changes to PO & check the Change Message.
    Give respective Output Message Type & Application(VF) for PO.
    Create Output types for a vendor in T.Code MN04, else take help from MM Consultant.
    Create a PO & save. Then make some changes in Po & again save.
    Now IDoc will be created while saving the Po & IDocs will be created whenver you make changes to PO and saving it.
    Hope It helps.
    Regards,
    Anbalagan

  • How to change the order of columns in a speadsheet?

    It seems this would be completely straight-forward. However I can find nothing in help to tell me how to do this. I am using a spreadsheet for data so want to be able to rearrange in the order of the columns. How does one do this?
    Thanks.
    John

    I don't want to move or sort the data. What I want
    to do is change the order of the columns. I have
    columns A through P. I want to move columns M, N,
    O, and P to come after A and B so I can see the
    information in these 6 columns in one glance.
    How does one do that?
    One doesn't, but there are altenatives.
    1.
    Select columns C..L by clicking and dragging across the column headers.
    Go Format (menu) > Column width.
    Set the width to 0 (zero) and click OK.
    This hides columns C..L, showing A, B, M, N, O, P...
    You can still enter data into cells in columns C..L by clicking on a cell in column B, then pressing tab to move through the hidden columns.
    To restore the display, select columns B..M then reset the column width to a visible value (the current width of column B will be the default).
    2.
    Copy the values in columns A, B, M, N, O, and P into a set of contiguous columns. Set a New View to show these columns in a separate window.
    Example:
    Go Window > New View
    Drag the new window that opens up and left to cover the initial window.
    In AA1, enter =A1
    Select AA1..AB1 then Fill right (command-R)
    In AC1, enter =M1
    Select AC1..AF1 then Fill right
    Select AA1..AFn where n is the last row in which you have data then Fill down (command-D)
    This copies the contents of the cells you want to view together into a set of cells that are together. You can view them by going to the Window menu and switching between the two views of the same spreadsheet. Or you can skip the step of creating a second View, and scroll from one location in the sheet to the other.
    The usual caveat applies: Anytime you're making extensive changes to a document, work with a COPY and keep the original as a backup you can revert to should a misstep along the way result in data loss.
    Regards,
    Barry

  • Distributed JDBC/JMS transaction commit order

    I am using WLS 10.3.0. I have an app with container-managed EJBs which participate in distributed transactions using XA drivers for two resources, (1) a jdbc connection to Oracle database, and (2) WebLogic JMS server. In a typical EJB call, I am writing a record to the database and sending a message to a local queue which is being consumed by a MDB. My question is how can I guarantee that by the time the MDB receives the JMS message, the record will be guaranteed to have been committed in the database. It appears that occasionally the record is not yet there. Is there a way to force the jdbc commit to happen before the JMS message gets consumed? I know there is a commit_point_strength parameter that determines commit order for the database resource, but I don't see such a concept for JMS...

    "The Default Time-to-Deliver attribute for XAConnectionFactory for the Weblogic JMS connection queue, is a minimum interval from when the message is SENT, to when it is available to be processed. What is really needed is a delay from COMMIT time -- not from the sent time."
    <jay>
    Not entirely true. Delay is not from when message is “SENT, Default Time-To-Deliver is delay at within JMS subsystem before it delivers message to consumer. It means that "Send" thread will not block for this delay and "Send" side executes no different whether there is "Time-to-Deliver" configured or not.
    </jay>
    "For example, imagine a distributed transaction does a JMS send, followed by a query that takes 10 seconds, followed by a commit. If Default Time-to-Deliver is set to 5 seconds, it will be completly ignored, since the 10 seconds from the send to the commit is a larger interval. So at commit it is still very possible that the MDB will receive the message before the database transaction is committed."
    <jay>
    This is not true also. JMS message will be available for delivery only after distributed transaction commits and more specifically "commit" part of the JMS resource completes - clock for "message delivery delay" will not start until distributed transaction is committed. Considering transaction will not commit until slow running query completes execution above scenario will not cause “Default Time-to-Deliver” workaround to fail.
    Slow execution of the XA.commit() request from TM (Weblogic) to database may cause concern , however considering that TM (WebLogic) receive response of the XA.prepare() from all participating resources before XA.commit(), commit should execute with delay not more than few milliseconds and chances are negligible that proposed workaround will fail.
    </jay>
    "The bottom line, is that this parameter is not an effective way to control the race condition unless the JMS send is always performed as the last action in a distributed transaction.
    For this reason we have gone with inserting a small configurable sleep at the start of the onMessage() methods in the MDB. Not a very elegant solution, but the one ne that works reliably."
    <jay>
    I think "Default Time-to-Deliver" is no less effective or no less reliable solution than placing sleep() in onMessage(), however it is more cleaner solution because it uses application server built in feature instead of updating code in onMessage().
    </jay>
    -jayesh@yagna

  • How to change the order of shapes

    hi,
    if I have two shapes on the canvas, one is oval, another one is rectangle, rectangle is partly on the
    oval. Now I want to change the order, oval should be to the front, partly on the rectangle.
    how can I do this?

    you need to make sure you draw the oval after you draw the rectangle.
    this will result in that the oval will be on top of the rectangle.

  • Automatic ORDCHG Change Purchase Order after Order response from Vednor

    Hi
    How to trigger Change Purchase Order action after receiving PO Confirmation - Order Response from Vendor.
    The scenario is that Order Confirmation vednors sends contains delivery date or delivery qunatity variance within defined tolerances. In such cases it is acceptable to allow automatic PO change.
    This is an EDI scenario. Idocs ORDRSP and ORDCHG in use.
    Thanks for hints.
    Mariusz

    - For automatic document adjustment, you must make the necessary settings in Customizing (SPRO ->Materials Management->Purchasing->Conditions->Automatic Document Adjustment). The system logs all the relevant purchasing documents and can therefore determine all the documents affected by a change to a condition.                                    
    - This is only possible for purchasing documents for which follow-on documents (goods receipt, invoice receipt) do not exist.           
    - Before you run this report, you must have run report RMEBEIN4 (creation of worklist for automatic document adjustment).

  • How to change the order type

    Dear friends,
    Please tell me the transaction code to change the orger type.
    suppose  we have an order having type Zrox we want to change the order type from Zrox to Zmto what should I do and how can I do .

    Hi
    For single order use <b>VOV8 </b>and for Mass use T code <b>MASS</b>
    <b>
    Changing by MASS</b>
    There is transaction <b>MASS </b>which can be used to carry out mass changes in the sales order and other objects.
    Mass Maintenance: (Use to change multiple fields in multiple documents at the same time). I have done mass change for customers; and orders should work the same way too.
    1) Try t-code [MASS] and select sales orders & execute
    2) Choose the table or tables for your selection criteria and also for fields you want to change.
    Then execute. (suppose your selection criteria fields are from “sales order header data” table and the field you want to change, is in “item data” table)
    3) Put in the sales documents(21000000, 21000001) you want to change and also the items(10) you want to change. – click on ” choose selection fields” button – From the Pool, move the fields you want to the “select fields” using arrows.
    4)From mass maintenace menu, click on “Enter new field values”
    -click on “sales order item data” tab and choose the field you want to change.
    (for example. I want to change plant for item 10)
    -enter the new value (of the plant to be)
    -click on “Adopt” and execute
    5)In “sales order item data” tab, you see the new value of the plant you entered at the top and the old values of item 10 are below.
    -click on “change field values” button. you see all the old values are changed to new values.
    -save
    Note: it will take some time depending on how many records you have.
    Check: Go to [SM37] and see the status of the job you are running and once finished, export the spool file to a spreadsheet.
    Before you do mass maintenance, go to the particular table in [se16] and get the results. Then do the mass maintenance and compare the results with this one. If they match, then you are good to go.
    Note: If you have any user exits that affect the results, ask them to deactivate the MODCHECKS still you are done with mass maintenance & activate them again.

  • CO02 - Change Production Order

    Hello,
    I have setup a workflow event to trigger if a production order is released using tcode BSVZ - System/user status events (which I read about in the SDN forum).  This seems to work just fine for an order release.  However, I have not found a way to trigger an event if a production order changes using tcode CO02, for example.  Any ideas?
    Thanks,
    Kenneth

    I think I may have solved the problem.  In tcode BSVW - Status Management, I had setup ORH for ZBUS2005 Release Event.  I had restricted this event with status I0002 - Release.  Therefore changing an order in CO02 would only trigger the event if you released the order.  I removed the restriction I0002 and tried changing the order total quantity.  The event now triggers when changing the total quantity.
    I had tried adding the restriction I0558 - Changed, as Imthiaz had suggested, but this did not work in our system.  Totally removing the restrictions did work for this scenario.
    Setting up change documents in SWEC did not work for some reason neither with change document ORDER nor RKAUFTRAG.
    Thanks Imthiaz for heading me back in the right direction again.

  • Change Song Order in Library

    First let me start by saying this is my first question. I woudl like to know how I cn change the order of a track number in the Library section of iTunes? I have imported several CDs, I had issues with one of them where it would not import the song due to the CD being scratched, I purchased the additonal required songs from iTune, however the order is not the original for example CD had 12 songs, I was able to import 8 songs, 1, 4,5, 8, 9, 10, 11, 12, I went and purchased tracks 2, 3, 6 and 7. I have the track view enable so I can look at what track the songs are, when I do the songs show up 1, , 4, 5, 8, 9, 10, 11, 12, 2, 3, 6, and 7. I would like to change the order to be the same as the CD. i realize if I make a playlist I can do this and if I burn a CD I can also do this, I want to know how to do this in the actual iTunes Library.
    Thanks

    I'm having the same problem but it's a compilation album, so the artist name is different in each track, but the album is the same and the track order is clearly listed, so why does iTunes change the order of the tracks?????? Whether I check "compilation" or don't check compilation it's the same result, the song order changes in the playlist. Any thoughts? Thanks.

  • How can I change the ordering of the parameters listed under the Labview module?

    Is there anyway to change the ordering of the parameters listed in the parameters table under the Labview module tab in TestStand?  Each of these parameters printout in my report, but I need to change the ordering of the parameters in the report.  Thanks.

    Hi,
    There is not a way to manually change the order of the parameter values in the Code Module Parameters Table, but there are a few options for configuring the report ordering of these parameter values.
    Option 1: Use the Additional Results in the Properties tab to add a Custom Result. You can then save the parameter values to these custom results and order them they way you desire. This ordering will be reflected in the report.
    Option 2: You could use a Post Action in the Properties tab to swap the parameter values that are saved to Locals.ResultList[0].AdditionalResults at run-time. This would require the use of a local variable to serve as a temporary placeholder for one of the values in order to successfully swap the values.
    -Adri
    Adri Kruger
    National Instruments
    LabVIEW Product Marketing

  • Change to Order Related Billing from Delivery Related

    Hi,
    We have a scenario where we want to change to Order Related Billing from Delivery Related. The Sales Order Have already been created and for some of them the Delivery has alsobeen done.
    Can we change to Order related billing and would it work for all sales order created previously.
    Thanks & Regards,

    Hi,
    It will work if you change this to order related billing.For this Goto the T.Code "VOV8".Select your document type.
    Details.
    Goto the "Billing" tab.
    Maintain the order-related billing type.
    Next step is to goto the T.Code "VOV7".Select your item category.Details.
    Goto the "Business data" tab.Change the Billing Relevance field to either "B/C/F/G/I" as per your requirement.
    Last step is to maintain the copycontrols between your order and invoice by using the T.Code "VTFA" and also for your item category.
    Regards,
    Krishna.

  • Create an Applescript to change focus order in browser

    Hey all,
    I'm curious if it is possible to create an Applescript to change the order focus within a browser.
    I have a bulk of data that needs to be entered into a database online.
    The focus order of the website design is not logical hence pressing tab to move from one field to the next results in confusion.
    (It includes buttons in headers, footers and empty fields making this extremely frustrating as I have to continuously use the mouse)
    Google search has not really given me any results, so I was hoping to build one.
    Thanks,
    Cheebs

    I think it is unlikely that you will get far with AppleScript as this normally involves reverse engineering the web page HTML/JavaScript and perhaps having a modified local copy of some or all of it.
    Are you able to paste the URL here without security implications?
    You could try looking at the source HTML of the web page.
    I am not sure if anybody makes a special web page viewer which has more control than a standard browser.

Maybe you are looking for

  • How do I enlarge a document when it prints.

    I need to enlarge a template. So I want to set the printer to copy the original and enlarge it at the same time. How do I do this with an all-in-one Office Jet Pro8610. Thanks for any help. This question was solved. View Solution.

  • "Authentication failed. User is already authenticated as a different user."

    Hello, Initially I was not able to log into the Visual Admin. When I logged into the Visual Admin, I got authenication failed. I reset the password of Administrator in the User Administration on the portal. Now I can log into the Visual Admin using t

  • It worked!

    I updated my iPhone 4 with iOS 5 last nite and all is well.  I even watched the entire process as it really didn't take that long, and the only reason I'm posting this is to give people confidence to do this after reading all the horror stories here.

  • Solution Manager - Monitoring - Instance Status

    HI all,  I'm trying to configure in "setup system monitoring" the alert on "Instance Status" but  is always in staus "Alert is active but not accessible".   The others alerts work fine.  I have already configured the ccmsping in rz21 and in rz20 ever

  • Trial Download of Adobe Premiere Elements 11

    I'm trying to download a free trial version ofAdobe Premiere Elements 11 I downloaded the download assistant App but can't seem to download the actual adobe premier elements. Whn I go to the download site and hit down load it takes me back to the dow