Commit & Rollback in procedure.

Hi All,
I am Using ODI 11.6 and Oracle 11 g.
I have a senario
where i have Int_1--->Procedure 1--------->Int_2
The int_1 will update Table_1
If the procedure_1 is succesfully runs then it updates Tab_2
Suppose the Int_2 will fail which will update the Tab_3
I need to rollback the Tab_2 and Tab_1.
How to do this in ODI?
So we have any kind of Commit option in Procedure?
Thanks,
Lony

lony wrote:
Hi All,
I am Using ODI 11.6 and Oracle 11 g.
I have a senario
where i have Int_1--->Procedure 1--------->Int_2
The int_1 will update Table_1
If the procedure_1 is succesfully runs then it updates Tab_2
Suppose the Int_2 will fail which will update the Tab_3
I need to rollback the Tab_2 and Tab_1.
Interface 1 & 2 should use KMs which runs DDL and DML operations is separate transction.
For your info , most of the shiped KM do this . Just verify the same once again
Once the above is done then note the DML operation is happening in which transtion . Say it is happening in transction1.
Set commit to no for INT_1
Create your procedure and set commit to no commit
In the procedure set the transction to the same as that ok INT_1 IKM ( say transction1)
INT_2 set commit to yes
Thanks,
Sutirtha

Similar Messages

  • TimesTen doesn't commit/rollback executed DMLs in procedure, so tables were locked.

    Hello, when PLSQL_TIMEOUT occured, TimesTen doesn't commit/rollback executed DMLs in procedure, so tables were locked.
    Please help. How can I solve this problem?

    Looks like I've a mistake, not PLSQL_TIMOUT, after ODBC connection timeot it seems doesn't commit/rollback.
    java.sql.SQLException: [TimesTen][TimesTen 11.2.1.8.0 CLIENT]Communication link failure. System call select() failed with OS error 110. This operation has Timed Out. Try increasing your ODBC timeout attribute or check to make sure the target TimesTen Server is running
    Also I couldn't find why locked and what locked. My procedure waiting for lock or something I dont know, so timout occured

  • Commit/Rollback in Stored Procedures

    I'm just confused about how this setup works. I understand that ODP.NET is in autocommit mode by default, and any INSERT, UPDATE, or DELETE commands are committed automatically. If they fail for any reason, obviously the row(s) are not modified.
    But how about sprocs? Do they autocommit as well? If so how are rollbacks handled? Do I need to explicitly create a transaction and commit/rollback? Is it best practice to commit/rollback in the .NET transaction or in the sproc itself?
    As you can see, I'm just really looking for info on how these two interact. Any info you can provide will be extremely helpful.
    Thanks!

    Hello,
    When ODP.NET is operating in auto-commit mode (the default as you note) this applies to PL/SQL calls as well.
    I am of the opinion that the client should be in charge of a transaction and I do not commit/rollback inside PL/SQL code (unless of course I am writing PL/SQL that is the client of other PL/SQL code).
    Here's a bit from Tom Kyte on the subject:
    http://tkyte.blogspot.com/2007/03/dreaded-others-then-null-strikes-again.html
    Just search for the text "Who control the commit?" on that page.
    Regards,
    Mark

  • How to avoid the Commit/Rollback dialog box

    I've a JClient app with two frames wich relate to the same appllication module with the same connection (I need it because I want a single commit).
    I start the first frame,then I click a button to start the second frame, I insert data in the second one and I see the commit/rollback buttons in both navebars enabled.
    When I close the secod frame, without committing (because I want to commit at the end of the whole process) I receive the Commit/Rollback dialog box.
    How can I solve that problem ?
    TIA
    Tullio

    Remove or conditionalize the code in generated Form/Frame.java class that binds a WindowListener to the Frame like:
        addWindowListener(new WindowAdapter()
            public void windowClosing(WindowEvent e)
              _popupTransactionDialog();
              JUApplication juApp = panelBinding.getApplication();
              if (juApp != null)
                juApp.release();
              System.exit(0);
      }You may either conditionlize the above windowClosing method or the code in generated method
    private void _popupTransactionDialog()

  • Commit/Rollback on Tab pages

    I have three tab pages
    1st tab page called master_detal_page. It is base block bound to tables.
    2nd tab page called Keyword_page. It is not bound to the table.
    3rd tab page called Exit_page. It will popup dialog box ask for save the changes. commit,rollback,exit_form on trigger when-page-change.
    I encountered problems that I was unabled ROLLBACK or COMMIT the change I made on 1st or 2nd pages. When I refresh tab pages always display back to orginal records.
    Please help me with any technical to solve it. Thanks
    Trigger: WHEN-TAB-PAGE-CHANGED
    DECLARE
    v_result VARCHAR2(30);
    BEGIN
    IF :SYSTEM.TAB_NEW_PAGE= 'EXIT_PAGE' THEN
    v_result := FUNCTION_DISPLAY_MSG_BOX('Do you want to
    save changes before existing');
    IF v_result = 'YES' THEN
    COMMIT;
    GO_BLOCK('BLK_1ST_PAGE');
    ELSIF v_result = 'NO' THEN
    ROLLBACK;
    GO_BLOCK('BLK_1ST_PAGE');
    ELSE
    EXIT_FORM(NO_VALIDATE);
    END IF;
    END;

    what is the error you got? go to menu/display error to see if any.
    Then it likely you got saving issue with your master-detail block.
    can you save with only master block data? but cannot save if both blocks have new data?
    if yes, then you may add when-validate-record trigger to master and detail blocks, with code forms_ddl('post');
    then see it makes difference.

  • Commit/Rollback Buttons Diabled for Pinned Tables?

    When I pin a table, the commit/rollback buttons become disabled. Is there a reason for that, or is it a bug?
    Java(TM) Platform     1.5.0_12
    Oracle IDE     1.5.0.52.03

    Finally got some time to let it return. 454 tables takes takes between 9-10 min. I also noticed if I cancel it, SQLDeveloper becomes pretty unresponsive....probably for the remaining 9-10 minutes, but I've been too busy to double check.
    As for the Commit/Rollback buttons becoming disabled in 1.5.0, I'm not able to get an exact sequence, it "just seems to start happening". It happens when I have multiple tables pinned. Changes to one will let me commit/rollback, but changes to another will not. The window with the disabled commit/rollback buttons sometimes will not even mark a rownum as changed if it has been updated.
    The refresh button still prompts you to save since changes were made. That works as a commit/rollback if the buttons are disabled.

  • Establishing commit-rollback mechanism in a transaction

    Hi,
    If there are more than one tables that records to be inserted into and more then one record for some tables, is it possible to establish commit rollback mechanism?
    It must be used repeater action for some tables because of more than one records to be inserted.
    I'm trying to establish commit rollback mechanism for all inserts for oracle database.
    Is it possible?
    Thanks.

    Hi,
    with the standard SQLQuery it is not possible. Sam has develop some custom action blocks with this
    functionality. Take a look on this link [Installing the SAP MII v12.1 JTA JDBC Custom Action Blocks.|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10bfa608-103b-2c10-6399-e41044c3363e]
    BR
    Pedro

  • Commit/rollback impact

    Hi!
    what is the impact of commit/rollback even without any changes since the last commit/rollback? Is it made the request to the logwr write from the redo buffer to the redo log file?
    Thanks a lot

    http://www.oracle.com/pls/db111/search?remark=quick_search&word=COMMIT

  • Commit / RollBack

    Hi,
    I want to execute 2 or more database operation in one transcation with commit/rollback mechanism.
    Below is my code,
    How can i make it has commit /rollback (in one transaction).
    Thanks.
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/SAPXXXDB");
    Connection con1 = ds.getConnection();
    Connection con2 = ds.getConnection();
    PreparedStatement pstm1 =con1.prepareStatement("insert into ZTABLE1(...)Values(...)";
    PreparedStatement pstm2 =con2.prepareStatement("insert into ZTABLE2(...)Values(...)";
    pstm1.executeUpdate();
    pstm2.executeUpdate();
    con1.close();
    con2.close();

    Hi Cemil Bozlagan ,
    When a connection is created, it is in auto-commit mode. This means that each individual SQL statement is treated as a transaction and is automatically committed right after it is executed.
    The way to allow two or more statements to be grouped into a transaction is to disable auto-commit mode by using Connection object.
    con.setAutoCommit(false);
    Once auto-commit mode is disabled, no query statements are committed until you call the method commit explicitly. All statements executed after the previous call to the method commit are included in the current transaction and committed together as a unit.
    Have a look
    PreparedStatement pstm1 =con1.prepareStatement("insert into ZTABLE1(...)Values(...)";
    PreparedStatement pstm2 =con2.prepareStatement("insert into ZTABLE2(...)Values(...)";
    pstm1.executeUpdate();
    pstm2.executeUpdate();
    con.commit();
    con.setAutoCommit(true);
    To roll back the transaction based on ur requirement u can use
    con.rollback()
    Regards,
    srikanth

  • Need to do a commit in a procedure called from a trigger

    How do I get around the need to do a commit in a procedure that is being executed from a trigger. I know it can't be done but I bet someone has a workaround. Thanks.

    Hi
    Why do you want to do a commit in a procedure called from a trigger?
    Anyway if you are running Oracle 8i+ you can declare the procedure as an Autonomous Transaction and can issue a commit, eventhough it is called from a trigger.
    HTH
    Arvind Balaraman

  • Commit Rollback for Parent & Child table

    Hi,
    I need to load data to a parent table and child table (Record by Record), i.e one record will be loaded to the parent table and the related child record will be loaded to child table.
    After first record loaded to child table, the next record will be loaded to the parent table.
    My requirement is, I should not commit the parent table before the child record is transferred (so that i can rollback if my record got failed). So I have set the parent table IKM commit option to NO. Because of this, my child record is not loaded to the correcsponding target table, its failed because the parent record is not commited.
    Do we have any possiblities to overcome this issue.
    Thanks in Advance,
    Ram Mohan T

    Cezar,
    I couldn't make the CKM options to "No Commit". When i did that i am getting the following error at step "16 - Control - CUSTOMER_DET - insert PK errors" ,
    12838 : 72000 : java.sql.SQLException: ORA-12838: cannot read/modify an object after modifying it in parallel.
    This error occurs at the CKM. so i have made all the CKM options to "commit" and IKM, LKM to "No Commit". It seems to be fine.
    Cezar,
    I have some plan for the scenario that i mentioned in the previous update (One dept id and all related employees). Please verify this,
    1) create a procedure which extracts dept_id from source tab and passes it to the scenario(in target tab) of a package.
    2) This package has the variable of dept_id, interface1 which loads data to dept and following that another procedure(2).
    3) This procedure2 will extract the emp_id that corresponds to the value of the variable dept_id. And passes this emp_id to tha scenario in target tab.
    4) This scenario is of a package which has the emp_id variable and interface2 for loading employees.
    While executing this plan, the problem is,
    1) Interface1 which loads Dept_Id is not commited (due to the KMs with commit set to "No Commit"), so that the employee records are getting loaded to the error table.
    2) I have made the interface1 KM commit option to "Default: Yes " (But still the Knowledge modules steps are No commit), but still the child records are getting loaded to error table.
    3) As per the above scenario, all these transforamtions are not taking in the same transaction. Thats the problem i believe.
    Do we have any possiblities to overcome this Cezar?
    Thanks in Advance,
    Ram Mohan T
    Edited by: T. Ram Mohan on Mar 5, 2009 11:43 AM

  • Commit inside stored procedure

    If you call a procedure from another procedure and issue COMMIT, then you commit not just inner stored procedure, but also outside procedure. Am I right? Can we make SP smarter and commit only statement in inner SP?

    But bear in mind that a rollback will have a similar effect. A rollback of parent transaction will not undo the work done in the autonomous transaction. That might be a issue to watch out for if you wanted to undo all the changes in the event of an error.

  • Commit inside the procedure..

    Hi,
    I have a 3 procedure, which conatain the INSERT, MERGE and then UPDATE.
    I need to put a COMMIT, inside the every procedure. if i leave the commit, when it will be committed.
    Please explain.
    -Sathya

    > I have a 3 procedure, which conatain the INSERT,
    MERGE and then UPDATE.
    need to put a COMMIT, inside the every procedure. if
    i leave the commit, when it will be committed.
    Generally, we can use commit at the end of the procedure and before the exception segment starts. But, since you are calling three procedures - you have to evalaute the bussiness logic of your coding. If it is stated that combination of these three procedure ultimately considered as one work. To establish that - you have to use commit inside the main block from where these three procedure is called.
    Ex:
    Procedure aaa()
       procedure x1( );  --performs some dml
       procedure x2( ); -- again perform some dml
       procedure x3( ); -- perform some final dml
      commit;   -- here you should use the commit
    exception
      when others then
         rollback;The reason is, if there is any exception between the three procedure - all the transactions will be rolled back - thus achieving it as logical unit work.
    Hope this will clear your doubt.
    Regards.
    Satyaki De.

  • Is COMMIT; required in Procedure body?

    Hi,
    How should the COMMIT statement be used within a Procedure or Function? I saw in the Procedures, some developers end the DML statement with COMMIT; some never issue a COMMIT.
    Can you please advise a good practice regarding the COMMIT statement?
    Thanks in advance for any help.

    asharma23 wrote:
    hi,
    its better to use commit inside a stored procedure since commit allows save changes in the database ,the changes so required by you will only be reflected if u ve used commit,also the database then points to(refers to) its last commit state, Without commit no changes will be made against the database and its objects
    Experienced developers know the essence of commit..Well, you've explained why it's necessary to commit data on a database, but you haven't explained or justified why you believe a commit should be inside a stored procedure?
    Would you consider that every stored procedure that performs DML should issue a commit after it? Or would it be better that the data is committed when the business logic dictates it should.
    e.g.
    I have some stored procedures that add a new employee details to my database:-
    . procedure add_employee_name
    . procedure add_employee_address
    . procedure add_employee_job
    . procedure add_employee_salary
    and one final procedure
    . procedure add_employee
    which calls all the previous four procedures.
    Should each of the individual procedures commit what they do or would it be more logical for the overall add_employee procedure to issue the commit once all of the procedures have been called?
    Imagine if each procedure committed and we were trying to add an employee, but somebody had typed in the salary incorrectly so it was not a valid salary. The employees name, address and job would be added and committed to the database and then the salary procedure would fail, meaning that the database now contains only 3/4 of the required data for a valid employee on our database.
    Now imagine if only the outer procedure committed. When the salary procedure fails we would rollback to the start of our logical business unit i.e. before this employee got added and report the error. The database would not end up with partial employee data, and our reports and other applications that rely on it would not break. Once the error is corrected the data could be put on completely and committed and it would meet the requirements for our reports and applications.
    Moral of the story... commit when it is logical to commit, not when you feel like it. ;)

  • In background job  how commit & rollback work works?

    Hello Friends,
         My requirement is, to fetch all sales order items based on some condition and load them into one table say OCC1 in job J1. Now the second requirement is to upload the job information J1 with job name, user name, end date in second table say OCC2 in job J2.
         My question is if there is some error I found while processing job 2 I have to rollback entire work which means I have to remove all records those I have inserted in to table OCC1. Can any one suggest me how to handle such problem? Some how I am able to create two job and update the tables. However, what about rollback work? Whether there is an implicit commit work after every background job? I am working on SAP 4.6C version.
    Thanks,
    Amol C.

    I think by using just ROLL BACK work it will not rollback your first job's data.
    You need to make some mechanism which can delete the data from OCC1 if the J2 got error.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • How to set "Borland L&F" in  my Application

    I can set Metal L&F like this: try{ UIManager.setLookAndFeel("com.sun.java.swing.plaf.metal.MetalLookAndFeel"); }catch(Exception e){e.printStackTrace();}; JBuilder 9 includes "Borland L&F" wat parameter have i to provide to UIManager.setLookAndFeel(?

  • Std Report  S_ALR_87013611  modification

    Hi , My requirement is to modify the standard report S_ALR_87013611 which developed on Report writer. It is drildown report writer report. It is calling the KSB1 transaction with user interaction. I want to modify the report by replacing the custom t

  • Bind vars and LOVs on same JSP -incompatible?

    I have managed to get a project working using bind variables, and another project working that has LOV. (Both using ADF,struts,JSP) However, when I try and use bind variables for one attribute and an LOV for a different attribute on the same JSP I ge

  • Weblogic Portal Admin Console is not displayed after the ear deployment

    Hi There is a Weblogic portal application deployed in the Weblogic Server 9.2 mp3 . The application is fine , when opened with the browser, but the problem is the portal admnistrator console is not opened. The application is deployed in a clustered e

  • Different session values when passing &APP_SESSION. as a parameter

    Hi all, I'm using APEX 3.1.1 and having the following issue: I have a JS function in my app, which builds an URL using the parameters provided. Its signature would look something like: function xxx(p_app_process, p_param_item, p_session, p_app_id) Ye