Program completion before database commit

Hello friends,
I am doing a mass update using batch input program. The issue is that my program completes before actual database commit.My requirement is to create info records and after calling the standard batch input program , i am checking  the standard tables if the info record is created or not. If yes, am updating the numnbeer else am updating an error message,
The problem is that for some 200 odd records there is no issue but if the no of records exceeds say 1000 or more, the background process of batch input program continues and then my code to check if the info record is created gets called. At this time,the database is still getting updated and there is no info record getting filled( info record actually gets  updated in the standard tbale after few mins).
I am pretty sure this is to do with database commit issue and can actually use wait statement but then i cannot always expliciltly say wait up to 100 seconds because the user can choose 1000 records or 1 record at a time. How to ensure that the database gets updated before my checking of the info record in the table.
Please help.
Regards,
Prem

Hi,
Try the following command before looking for info records in the database..
COMMIT WORK AND WAIT.
WAIT UP TO 2 SECONDS.
If this doesnt work.. then i feel you should split the program...
1st create all info records..capture the success/error messages.. once done
call the 2nd part which is related to validation of info record in database.
Thanks,
Best regards,
Prashant

Similar Messages

  • Issue with Database Commit

    Hello All,
    I have two include in my user exit of the sales order.
    In one include I am doing some validation on the Order quantity of the sales order depending upon the order quantity in one of my Z table. If every validation is OK then I am exporting this order quantity to memory ID.
    In the second include I am importing this Order Quantity and updating this Quantity in my database in my same Z table.
    If I process one order at a time then everything is working fine but when I try to create two sales order at the same time then only second order is getting validated and order quantity is getting updated whereas for the first order no validation is performed and also order quantity is not getting updated in the Z table.
    I really do not know is this issue related to database commit or something else.
    Kindly help.
    Regards
    Sachin yadav

    Sachin,
    I guess i am getting to understand your requirement a little bit,
    In validation I am modify the records in the Ztable as well I mean to say for each order created I am updating the Quantity in my Z table.
    So you are just updating the quantity fields in the Z table, and this doesn't have any affect on the actual order quantity what soever, is that right or is the order quantity changed or modified based on the entry in the Z table?
    So for the next order the validation should be done depending upon the new order quantity not the old order quantity.
    Now this is a little tricky, now by next order do you mean the next order with respect to the number range or the next order in general?
    For ex: Orders 1234, 1235, 1236 in order, or let us say there are 10 people around the world creating order simultaneously depending on the sequence in which their orders are saved.
    I mean to say for the first order the validation should be done depending upon the old Qty and for the second order validation should be done by new order Qty.
    When I am saving the two order at same time validation on both the order is done by old qyt bcoz new oder Qty from the first order is not yet upadated in the database when second order try to fetch the data from the Z table as i am saving both the order at same time.
    This is what will happen most probably, even though you use the lock concept, let me try and explain...once you save the order in the user exit you are locking the object with enqueue and dequeue...something like below.
    Order 1
    userexit_save_doc.
    enqueue ztable
    select from Z table
    validate based on the entries from z table
    update/modify the z table with udpated values
    dequeue ztable
    end of userexit.
    Now by the above code it doesn't mean that your changes are available in the Z table immediately, the table will actually be updated by the update modules along with other standard tables. Now in the mean time if an other order that hits userexit_save_doc before the update module of the previous order is complete it will still be looking at the old values.
    Now in order to overcome the above sitauation you might need to add a COMMIT WORK AND WAIT in the userexit. But this will compromise the data integrity of the order and IS NOT SUGGESTED.
    So you see, by locking the table you still haven't achieved your results.
    Now, you need to confirm if the entries in the Z table are used only for validation and updating of data in the Z table or does it have any kind of affect on the Order quantity or any other Order specific values in general.
    If it is only to track the quantity in the Z Table, and there is no affect on the order data in general, then i suggest that you create a  Z program and get all the orders that have been created/changed in a given period and then update the Z Table quantity accordingly, you can have this scheduled as a background job in the non business hours.
    Let me know if i was completely off track in getting your requirement
    Regards,
    Chen

  • Max no. of Update SQL statements before a commit

    In Oracle 10.2 what is maximum number of UPDATE statements that I can execute before issuing commit.
    If maximum is there either by no. of SQL statements or size in KB, what will happen if I go above this number.
    Thanks in advance for your response.
    Edited by: vbforums on Feb 21, 2011 3:50 PM

    sb92075 wrote:
    I executed 5000+ update statements from Java in one shotI am curious.
    Does each UPDATE change only a single row?
    I'll ask a different way.
    Can a single UPDATE statement change all desired rows?yes
    SQL> conn scott/tiger
    Connected.
    SQL> select table_name from user_tables;
    TABLE_NAME
    EMP
    DEPT
    SQL> create table mytest(cola varchar2(1));
    Table created.
    SQL> insert into mytest values ('A');
    1 row created.
    SQL> insert into mytest values ('A');
    1 row created.
    SQL> insert into mytest values ('A');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from mytest;
    C
    A
    A
    A
    SQL> update mytest set cola='B' where cola='A';
    3 rows updated.
    SQL> commit;
    Commit complete.
    SQL> select i * from mytest;
    C
    B
    B
    B
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@vmlnx01 dbs]$ exit
    logout

  • What is Database Commit and Database Rollback.

    What is Database Commit and Database Rollback.

    Hi Sir ,
    Please have a look below .Hope it is suitable and simpler solution for your question.
    Please do reward if useful.
    Thankx.
    In database level this will be used..
    Commit is nothing but SAVE the current record..
    If u rol back before commit means whatever u proceeded for the SAVING will be roll back and the data will not be stored..
    This will be used,When some times u r filling a register form..after filling 20 fields,In the 21st field u will not to registrer means it will be rollbacked using the Rollbeck command.
    In detail--->
    ROLLBACK->
    In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.
    · Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.
    · As a result of a ROLLBACK, a new transaction is implicitly opened.
    In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.
    In a restart, the system checks which transactions were canceled or closed with a ROLLBACK. The actions are these transactions are undone.
    COMMIT->
    In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.
    · Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.
    · As a result of a COMMIT, a new transaction is implicitly opened.
    In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.
    In a restart, the system checks which transactions were closed with a COMMIT. These actions are redone. Transactions not yet closed with a COMMIT are undone.
    From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.
    the statements
    COMMIT WORK.
    and
    ROLLBACK WORK.
    for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

  • Database commit event based dashboard page refresh

    Hi All,
    I have a requirement where the dashboard report page should get refreshed automatically whenever the fact table in the realtime datawarehouse gets updated with a new record insert. Then the dashboard report should show data from the new record too, plus all the data it was already showing.
    I.e I need a database commit based event to trigger the report refresh. Is there a way to do this?
    Also how do I ensure that the refresh looks for the new record from the databases and the existing ones from the cache? I do not want the query to run again on the database to pick all records, since the refreshed report needs to be displayed as soon as possible.
    Thanks
    Gaurav

    For this I am creating an ibot with the Conditional Request having the report with the query :
    select * from S_NQ_EPT where update_ts between sysdate and sysdate -1
    This will fetch any record entered in the S_NQ_EPT table in the last 24 hrs.
    For the ibot schedule I give the Recurrence : Daily, Repeat Every 60 minutes until 23:59:59 and End Date : None
    In Delivery Content I select a report for which I want to rebuild the cache This is not a good approach as report will keep on executing after every one hour.If you are running daily ETL load then it should be executed only once after completion of ETL load.There are ways to automate this process.See the below link
    iBot scheduling after ETL load
    You need to do some scripting to get it work.
    Now I want to rebuild the caches of all the reports. For that do I need to build a seperate ibot for each report, along the above lines or is there a better way?Generally for cache seeding through ibots you should create a detail level report and schedule that through IBOTS.For ex if you have 4 reports coming out of one subject area and supoose each have 3 columns each then create a single report having all the columns that 4 reports have and schedule it through IBOTS.Obviously you have to take a stand as to create schedule all reports or just one detail report.If detail report is taking too much time to execute then go for individual reports scheduling.
    Regards,
    Sandeep

  • Parent Request Completes before child

    Hi All,
    I have created a UNIX shell script that calls a sql script and it submits 3 concurrent request. The UNIX shell completes before the 3 concurrent request and i can not move my log files in the specific folder as they are not created till now.
    Is there a way, that i can make the UNIX shell script as pending until the 3 concurrent request gets over?
    I thought of creating another shell script that will be called after the 3 concurrent requests but i think there should be a better way of doing this.
    Any idea would be really appreciated.....
    TX
    K

    the only way to be certain that the database save is complete, is to return from that call.
    So it could return a page with an onload event which closed the child window, and refreshed the parent pane.
    ie
    rather than doing
    save()
    reloadParent()
    close()do
    save()
    (save call returns with html page to child window)
    (onload event of this form: )
    reloadParent();
    close();

  • Please Guide me to complete the Database installation.

    I have Installed Oracle9i Client in my machine as Administrator
    Now that I am trying to Install the Oracle9i Server in the same machine either as administrator or network User, But I am not able to install it. The system is not reading the CD dump that is available in my local Dump.
    Do I have to uninstall the client Version and remove the entries in the registry before installing the Server Version.
    Please Guide me to complete the Database installation.
    Thanks in advance...

    For installing the Oracle Server you have to install it in a different Oracle Server and the fact that you have a client install does not stop what you are doing
    Joel Pérez
    http://www.oracle.com/technology/experts

  • View SQL before i commit

    Hey gang, just say i'm using SQL Developer to delete some rowes out of a table. I've selected my rowes and i chose delete, before i commit is there any way to see the SQL statement that is going to be applied? I know that once i commit it, i do see it in the data editor log, but i want to see this before i commit. Possible?
    -Scott

    Yes: Preferences - Database - ObjectViewer Parameters - Post edits on row change (and obviously don't Set Auto Commit On ).
    Have fun,
    K.

  • HR - Programming without Logical database

    Hi All
    I have some doubts, I am mainly using Logical database while creting Reports in HR, if I want to use HR function modules and BAPI do they use logical database,
    question is when we have to do HR programming with Logical database and when without Logical database.
    cheers
    AJ

    Hi Srinivas
    If I am doing some Enhancement on ESS/ MSS , using Webdypros, I cant define Logical database anywhere, so I have to use Function modules or BAPIs ........???
    But usually in Reporting you can define the Logical database in the Program attributes.........so I think Logical database can only be used when it can be defined in the program attributes........if you have any other scenarios........please let me know
    regards
    AJ

  • I am trying to install an update of Microsoft office and I get a message that says.  This application must be closed ETC.....   I am running Parralell and I think it is there.  The two programs are "Microsoft Database Daemon" "SyncServicesAgent"....

    I am trying to install an update of Microsoft office and I get a message that says.  This application must be closed ETC.....   I am running Parralell and I think it is there.  The two programs are "Microsoft Database Daemon" "SyncServicesAgent".  How do I close these programs?

    If the Office updates have to be run through Win in Parallels, there's not really a section here that covers that , because Neither Office or Parallels are Apple products. There is only a small chance that you'll find someone with BOTH your conditions who just happend to look into a forum on older iMacs.
    Parallels has a forum here:
    http://forum.parallels.com/forum.php
    I think you'll get a faster response there.

  • Format Payments check printing program completes in warning APP-FND-00500:

    Hi All,
    I'm in process of converting Oracle Payables check printing from reports 6i to XML publisher.
    I created template, data definition and changed the output for concurrent program to XML.
    I tried printing check and 'Format Payments (Evergreen)' concurrent program completed with warning.
    Log file has following error.
    APP-FND-00500: AFPPRN received a return code of failure from routine FDUPRN. An error occurred while AOL tried to spawn the print process
    Cause: AFPPRN received a return code of failure from the OSD routine FDUPRN. An error occurred while AOL tried to spawn the print process.
    Any one there has any idea what this error is for.
    Thanks
    pallavi

    This could have something to do with the fact that your printer is not set up correctly. Can you run a plain text (OReports) file output to the same printer? If not, then the printer is not set up in FND correctly. If you can ...
    Remeber that unless you have a more modern printer that can handle PDF documents natively then XMLPs PDF is going to need to be converted to PS or PCL. I would suggest you investigate the PASTA printer driver and get that set up. It provides the ability to call a program pdf2ps for instance, to convert the PDF to PS. There is a bunch of info on metalink
    Tim

  • Calling an applescript inside a Javascript, waiting for it to complete before moving on.

    I've got a handly little applescript compiled as an app that performs an Adobe Illustrator action which exports the current file's artboard #1 to a specific location at 300ppi. I can even call it from a javascript... which is great because I want a javascript that will loop x times, changing text and exporting on each each loop. But, each loop will export a file with the same name... not a problem, I'll rename the file after each loop, and javascript will wait patiently for me the export to complete before moving on to the next step, right? Wrong! Javascript just keeps moving through the script.
    So, how do I get Javascript to wait until the AppleScript completes the export? I can't have it wait a specific amount of time...export might take between 2 and 180 seconds.
    My ideas:
    1) can the applescript fire some sort of event letting Javascript know to move on?
    2) Is there a Javascript equivalent to AppleScripts "do javavscript " command, which would allow me to move the Applescript code into my core javascript?
    3) I could kludge a stopwatch on the first loop, checking every 10 milliseconds to see if the exported jpg file has been written... then using that as a baseline timer to pause later loops (not great, because the file will exist while AI writes it, and JS may rename it and try to export the second loop before the first is done).
    for (z =0; z<copyArray.length; z++) {
    var jpgExt = "-01.jpg";
    var newExt = ([z] + jpgExt);
    var exportASfile = File('/Applications/Adobe Illustrator CS5.1/Presets.localized/en_US/Scripts/VCS_Specialty Scripts/StandardExport.app');
    exportASfile.execute();  // export the file
    renamedFile = new File(exportFile); //variable exportFile is a reference to the jpg being written by the export
    renamedFile.rename (exportFile.name.replace(jpgExt, newExt)   ); // replaces part of the filename with a new

    I'd love to stay in one language, but since we're stuck on CS5 here, I have to make do.
    My task for the script:
    1) pop up a window to collect: 1a) number of copies, 1b) custom text, 1c) choice of three radio buttons -- I can't figure out how to do this in AS besides popping up three separate dialogs, I have it working great in JS
    2) loop step 1, write a named text frame with an array value containing a concatenation of 1a, 1b, 1c  -- pretty easy in either
    3) loop step 2, export the file at a higher than 72ppi resolution with artboard -- currently controlled by an action, can't be done programmatically in either AS or JS using CS5
    4) loop step 3, rename the file to match what was written to the text frame -- again, pretty easy in either
    In CS5, neither JS or AS have the ability to control the resolution of a jpg when exporting.... just the scale. So an action is required.
    My window JS has some of the basic edittext, statictext, buttons, panels elements, not too tricky:
    var win = new Window ("dialog","Cover Copy Builder");
        win.orientation = "column";
        win.add ("statictext", undefined, "Copy and Format Instructions");
        var input = win.add('panel', [0,0,320,300],  undefined, {borderless:true} );
        win.add ("statictext", undefined, "Output Summary");
    etc.
    Is there an AS equivalent to this sort of window building construction?

  • How does works default parameters in a program with logical database PNP?

    Hi Friends,
      I have a basic program, i need to filter info with period parameters in a program that uses logical database PNP, but it doesn't work.
      If i use "person selection period" that it's suposed to filter info according to infotype 0001 (as the sap help says), it doesn't work, i use: PNPBEGPS = today and PNPENDPS = today, and the result it's a lot of registers that doesn't meet that criteria.
      Also i tried with: data selection period, today, up to day, current month. And the result it's with the same problem.
      How does works period parameters in a program with logical database PNP?
    This it's the program example, i use the default category.
    REPORT  ZRPHRTEST.
    tables: pernr.
    infotypes: 0001.
    start-of-selection.
    get pernr.
      write: pernr-pernr, p0001-begda, p0001-endda.
    end-of-selection.
    write 'fin'.

    Hi,
    Define pernr table under tables statement then and use GET PERNR event.This get event is followed by End-Of-Selection.
    Syntax: Tables pernr.
                Get pernr.
    Try, activate and test. This should solve your problem.
    Regards,
    Abhijeet

  • HT201359 I purchased the program from before, why was the discount amount on a program previously purchased

    I purchased the program from before, why was the discount amount on a program previously purchased
    Item     Developer     Type     Unit Price
    Learn English with busuu!, A1 - Beginner
    Report a Problem      Busuu Limited      In App Purchase     $4.99
    Order Total:     $4.99
    Please retain for your records
    Please See Below For Terms And Conditions Pertaining To This Order.
    Apple Inc.
    You can find the iTunes Store Terms of Sale and Sales Policies by launching your iTunes application and clicking on Terms of Sale or Sales Policies
    Answers to frequently asked questions regarding the iTunes Store can be found at http://www.apple.com/support/itunes/ww/
    Apple ID Summary •  Purchase History
    Apple respects your privacy
    Information regarding your personal information can be viewed at http://www.apple.com/uk/privacy/
    Copyright © 2011 Apple Inc. All rights reserved
    <Personal Information Edited by Host>

    Sorry, but I don't understand your question. What "discount amount" are you referring to?

  • Is there a way that you can have two different text fields (email, phone) that one at least one of them must be completed before submitting the form? Can it be done using javascript in the validation tab? if so, how?

    Is there a way that you can have two different text fields (email, phone) that one at least one of them must be completed before submitting the form? Can it be done using javascript in the validation tab? if so, how?

    Here is one solution:
    // mouse up action for submit button;
    function GetField(cName) {
    // get field object for cName field with error checking;
    var oField = this.getField(cName);
    if(oField == null) app.alert("Error accessing field named " + cName + "\nPleae verigy field name, spelling and capitalizeation.", 1, 0);
    return oField;
    } // end GetField function;
    var oPhone = GetField("phone");
    oPhone.required = oPhone.value == oPhone.defaultValue;
    var oEmail = GetField("email");
    oEmail.required = oEmail.value == oEmail.defaultValue;
    if(oPhone.required && oEmail.required) {
    app.alert("Missing required fields.", 1, 0);
    } else {
    app.alert("Submitting form", 3, 0);
    // additional code for submission;

Maybe you are looking for