Programmatic Rollback

Hello..
I have a Main Container Page, where I perform Include for various Pages.
Each Page has a Query Page and a Create Page Instance for a corresponding VO.
When I firstly open the Query Page, works fine and returns data, but when I navigate to the CreatePage, since the "Create" invokeAction fires a new empty row is created. So far so good. The problem is that when i navigate back to the Query Page, i find it also ready to insert a new row, while I need it to just Query data (although the Creation InvodeAction is connected with a RefreshCondition depending on the Page). If I press the "Rollback" button which is placed within the QueryPage, it exits from Insert mode, and queries data back again.
How can I apply the Rollback operation to be performed on the PageLoad or even programatically?
P.S.
The Page Definitions of both pages are included within the MainPage.

RJundi,
Let me see if I understand what you are saying:
Query Page ---nav case--> Create Page (which has a CreateInsert invoke action)
Is this correct? If so, why not have the button on the Query Page, instead of just being bound to the navigation case, have it fire the createinsert and then navigate? This is probably more what you want. To do this, drag the "Create" item from the data control panel and drop it on the query page. Then, go to the page def, change the action from Create to CreateInsert.
Finally, back on the query page, double-click the button/link you created, have JDeveloper create an action method in your backing bean, and have that method execute the createinsert binding and return the navigation case.
Hope this helps,
John

Similar Messages

  • Dynamic build of a table trigger - Issue building :new and :old vars

    (which leads me to my next issue - this one might be a deal killer for me; see "Are Optional Parameters possible in Procedural Units?"
    I'm using a Select statement to dynamically create a table trigger which looks like the following:
    create or replace trigger tr_audit#reporter
    after update on reporter
    for each row
    begin
    ttms_audit_pkg.insert_audit_info( 'reporter', 'ZIP', :new.ZIP, :old.ZIP, 'REPORTER.REPORTER,REPORTER.PROJECT_CD', 'EXFC', :new.reporter, :new.project_cd);
    end;
    The :new. and :old. variables are generated based on which table_name is passed to the script creating this trigger. My problem is that I need all the :new. and :old. parameters to be passed in as Char. regardless of whether they are Number or Date variables.
    So in the example above...if :new.reporter is a number on the table then I need to to_char is like this:
    create or replace trigger tr_audit#reporter
    after update on reporter
    for each row
    begin
    ttms_audit_pkg.insert_audit_info( 'reporter', 'ZIP', :new.ZIP, :old.ZIP,
    'REPORTER.REPORTER,REPORTER.PROJECT_CD', 'EXFC', to_char(:new.reporter), :new.project_cd);
    end;
    However, since this trigger is created dynamically I will not know in advance which :new. and :old. parameters will need to be converted to character. So if to_char(:new.reporter) is used and :new.reporter is already a character on the table then I will get an error.
    So my question then is this. Is there a way to write this dynamic sql in a way to accomidate this problem? I'm thinking something that would act a bit like a decode does with values...pehaps something like this:
    decode(:new.reporter, NUMBER, to_char(:new.reporter), DATE, to_char(:new.reporter,'DD-MON-YYYY HH12:MIPM'), :new.reporter)
    ...if :new.reporter is a number then to_char it; if :new.reporter is a date then to_char it; otherwise let it be.
    By any chance does anyone know if this is possible? I would greatly appreciate any insights.

    Sure, you can selectively version-enable tables using Workspace Manager (you call DBMS_WM.EnableVersioning on each table you want Workspace Manager to track history for).
    What do you mean by "programmatically rollback changes"? Workspace Manager has the ability to call GotoTime and queries against a version-enabled table will return results as if you were querying it at that specific point in time (unless you've purged history of course). You can also use it to create what are essentially long-running transactions where you can work on multiple sets of proposed data changes simultaneously for days or months before finally deciding to commit a one particular set. It's incredibly powerful.
    Justin

  • How to run my program in "test run" mode, programmatically ??

    Hi,
    Assume I have written a Zprogram and called a BDC to input a batch of data from an CSV file. I could see that in a normal input mode, some of the SAP transactions allow me to select "Test Run" so that SAP first checks if the data I enter is correct and can be saved. It then reports a succes and then I re execute !! U can see that option in transaction KP90, Delete Planned cost.
    Can I do the same programmatically so that I ensure that my batch data upload will be successful for this set of data ??
    Also, another question related to BDC... what happens when a record fails to confirm the SAP input rules ?? will only that be skipped from the batch input and rest be stored in the DB or will the entire batch of data will be reverted , something like ROLLBACK ??
    thanks

    hi,
       set one flag in the program for test run.
       if flag = 'X'.
          write success message here.
          dont save ur data
       else.
         save ur data
       endif.
       regarding ur 2nd question if one record is error also the data will not be updated for all the records.
       as u had mentioned it will ROLLBACK

  • JDBC adapter Commit/Rollback

    Hi Guys, I got a question regarding JDBC adapter auto commit. Hopefully you guys can help me :). Until now, when my XI calling a storedprocedure in ORACLE using JDBC adapter, it will automatically commit the calling. When i see my configuration for the JDBC adapter receiver, the checkbox for Enable Autocommit is thicked. My question is, is there anyway that we handle the commit or rollback ourself. How we can handle that? Is it from the BPM or just from the Configuration.
    Thank you very much in advance for all replies, advices and answer. Cheers guys..

    Hi
    Try this out
    You can programmatically set auto commit to true as in follows
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    // Connect to the database
    // You can put a database hostname after the @ sign in the connection URL.
    Connection conn =
          DriverManager.getConnection ("jdbc:oracle:oci:@", "scott", "tiger");
    // It's faster when auto commit is off
    <b>conn.setAutoCommit (true); </b>
    // Create a Statement
    Statement stmt = conn.createStatement ();
    regards
    krishna

  • Rollback a transaction in a session bean BMP?

    The following code would work correctly if executed in a stateless session bean BMP?
    InitialContext ic = new InitialContext();
    javax.sql.DataSource dataSource = (javax.sql.DataSource) ic.lookup("java:comp/env/jdbc/OracleDS");
    Connection conn = dataSource.getConnection();     
    conn.setAutoCommit(false);
    Statement stmt = conn.createStatement("UPDATE TABLE_A SET NAME = 'Duke' WHERE ID = 7");
    stmt.executeUpdate();
    if (someCondition) {
    conn.commit();
    } else {
    conn.rollback();
    My question:
    It�s possible to rollback a transaction using rollback() from Connection class in a stateless
    session bean BMP?

    Dear JDC member:
    With EJB, you can gain the benefit of transactions without performing any transaction programming. That is, your enterprise beans never explicitly issue a begin, commit, or abort statement. The container performs it to you. But you have to tell the container how to do it. As you might know, the deploment descriptor is the place for it.
    But nothing prevent you to do do programmatic transaction as you want.. For that case you have to know JTA (Java Transaction API) and more.
    Suppose the transaction aborts, you have to throw an exception back to the client or try it again. The issue here is with stateless sesssion beans, there is no in-memory conversational state. You might think to implement javax.ejb.SessionSynchronization interface with your business methods....
    You see there is a lot to know. You can take care of transactions in the client code, but it is a bad design.
    You have to understand today most application servers (Websphere, Weblogic...) are designed to minimize those issues in order to make developers' tasks easier. The container takes care of transactions.
    Be careful when you write stateless session beans BMP (BMP are for entiti beans)
    Regards,
    Armand Komenan

  • UncommittedDataWarning raised from a programmatic VO

    Hello everyone!
    I'm using jDev 11.1.2.3
    We have an ADF application and we just inserted the uncommittedDataWarning="on" in the af:document in all .jspx pages.
    Things seem to be working OK in all .jspx pages except a few ones with the following characteristics.
    These pages have a small panelGroupLayout with some very important filter criteria (input fields) that the user uses to refine his/her query results. It's not a VC.
    The criteria entered by the user actually feed a programmatic VO, some checks are performed and finally some executeWithParams are executed.
    The results shown to the user are read-only and everything is fine up to now.
    The point is that when the user tries to navigate away from the page, he/she gets the warning:
    This page contains uncommitted data.
    Would you like to perform navigation?
    Press OK to continue, or Cancel to abort navigation.It is the changes in the programmatic VO that raise the flag of uncommittedDataWarning.
    That shouldn't be happening since the user does not make any obvious change. He/she doesn't even have commit/rollback operation available (since it doesn't make sense).
    Do have any idea how to tackle this problem? uncommittedDataWarning is a very nice feature that we want to use...
    Thanks a lot
    ~apostolos

    I think that that might be due to the criteria which is actually being percolated through your ADFm Binding layer.
    How do you actually feed the programmatic VO for executeWithParms ?
    See details of how it works here
    http://one-size-doesnt-fit-all.blogspot.com/2010/02/adf-faces-rc-afdocument.html

  • Create, commit, rollback button behavior

    I have a view object dropped as a form. It has the default create, commit and rollback buttons.
    On initial display, only the create button is enabled, and the form is read-only.
    I click create button, which then it allows me to enter input.
    Upon clicking create button again, the form saves the input, clears itself, awaiting next input, and both commit and rollback buttons become enabled. I can continue to add more rows using create button.
    When I click either commit or rollback, the form becomes read-only again, and only the create button is enabled.
    This is the JDev standard form behavior which I want.
    Now, I add just 2 more enhancement, and this behavior gets broken.
    First, I drop the same view object as a table underneath the form, so that as records are added, the table will reflect it.
    Secondly, the form has two selectOneChoice components whereby upon valuechange on the first selectOneChoice, the second
    selectOnechoice items are dynamically populated via bean method and partial trigger.
    With these 2 changes, the entire page behaves like following:
    Upon create click, it gives me the form, but subsequent click on create does not clear the fields.
    If I click the create again, it then clears the fields. So, it takes 2 clicks on create to get a cleared form.
    But, it adds the row because I see it in the table below, but only one column displays the value in the newly added row.
    Upon commit, the row displays all values.
    Another thing is it fails to save the value from the second selectOneChoice field.
    Could you please point out what I am not doing right here?
    I would appreciate your insight.
    Thanks.
    Edited by: paikyunki on Oct 23, 2008 6:31 PM

    Chris,
    I might post the code tomorrow in my office - I am home now. Thanks for your offer.
    I gave some thoughts to my problem later, and it seems like one easy way out would be to create a form using ADF Faces components, then write a service method to insert a new row
    from the data gleaned through this form.
    I am new to JDev, and this approach of not utilizing the built-in functions of JDev may seem like defeating the very purpose of JDev.
    I find Oracle's Business Component's non-gui model very understandable and a strong alternative to Hibernate/Spring.
    However, it seems like sometimes it just may be easier, such as in this case, to resort to programmatic way.
    What is your view on this? I have used JDev less than 3 wks and would like to hear from experts.
    Yunki

  • Programmatic changes to textbox values won't stick...

    Using BC4J I have created textboxes that are bound to the Oracle backend. When data is entered or edited manually the app sees the change and activates the save and rollback arrow icons.
    Code behind my buttons can change the data in the bound textboxes but the changes don't cause the save and rollback icons to activate. If any controls on the page are then manually edited the programmatic changes disappear. I know this is because the mSomeAttribute.setText("somevalue") isn't connecting to the bound data sets (rowset ?) but I have been unable to find where/how to access such bindings.
    I can see the in the *RowImpl.java methods the get<someattribute>() and set<SomeAttribute>() functions, but I am not able to access these 'accessors' in in the Form java script, only the constants that reflect the field nnumber for the attributes.
    So, how do I connect programmatically to the attributes in a way that the modified data is seen by the bindings?

    You want to change the value in the view-row, not in the text box.
    Certainly one way to get access to this (all from memory, so the method names might be slightly out) is to get the application module from the panelBinding and then find the view from the application module and then get the current row from the view. Er, i.e.
    Row row = panelBinding.getApplicationModule().findViewObject("the-name-of-the-view-to-which-you-bound-the-control").getCurrentRow();
    Then you can use the set / get methods you spoke about. (Strictly speaking, from the client-tier you should generally be using the Row interface rather than the RowImpl class.)
    However, I wonder whether a more encapsulated way of getting access to the view-row is to start with the control and get the row via some ControlBinding or other. Only I'd have to dig around myself to work out how to do that so I'll leave it to someone else....
    HTH
    Mike.

  • Stay on previous or next row on rollback.

    Hi,
    I have an af:table where a new row can be created. On Rollback, current selected row is first. Instead of moving to first row, how I stay on any previous or next row ?
    I am programmatically setting current row in bean but since row is lost by rollback, when setting current row NPE is coming.
    Jdev 11.1.1.3 , ADF RC, BC.
    Thanks.

    Hi,
    You can achieve your desired functionality very easily by following the following steps:
    1. Override the prepareSession method of your Applicaiton Module implementation class and denote to the framework not to clear the cache after a rollback by using getDBTransaction().setClearCacheOnRollback(false)
    2. If you are using a read-only view object, you need to enable the findByKey method by overriding the create method of the view object implementation class and adding the following after the call to super: setManageRowsByKey(true);
    3. Lastly, you need to override the beforeRollback and afterRollback methods of your view object implementation class to get the current row before rollback and set the current row after rollback.
    Give it a try. If you find diffulties overriding these two methods then just reply to my message and i would be glad to provide you with sample code.
    Regards
    Antonis

  • Does Entity Bean allows Programmatic Transactions.

    Hi,
    I would like to know whether Entity beans allows Programmatic transactions. If they are not allowing then, if we want to abort the transactions then how we can do that.
    Regards,
    Satish. G

    In case ur application throws runtime exception u need not worry about aborting the transaction. container takes care. suppose based on some condition (or possibly application exception where container won't do rollback automatically) if u want to abort / rollback the transaction you can call setRollbackOnly() of EntityContext which informs the container not to commit the transaction
    - Paul

  • Get column values from list of values programmatically

    hi all
    how i get column values from list of values programmatically in the
    returnPopupDataListener method

    If this answers your question , please close this thread by marking it as answered.
    Thanks

  • Error in Updating a Result Set Programmatically

    Could anyone please help me !
    Why the row is always corrupted after executing the following code.
    I am using JDK 1.4 , the default JDBC:ODBC driver from sun and MS Access 2000
    try
    rs.updateString(1,jtfCity.getText().trim());
    rs.updateString(2,jtfCountry.getText().trim());
    rs.updateInt(3,Integer.parseInt(jtfPop1995.getText().trim()));
    rs.updateInt(4,Integer.parseInt(jtfPop2015.getText().trim()));
    rs.updateRow();
    catch(SQLException sqle)
    System.err.println("Error in update row");
    System.err.println(sqle);
    System.err.println(sqle.getMessage());
    System.err.println(""+sqle.getErrorCode());          

    Thanks for replying
    This is what I get:
    java.sql.SQLException:[Microsoft][odbc Microsoft Access Driver]
    Let me give you more background information. I am new in JDBC and is learning it by going through the examples in "JDBC API Tutorial and Reference 2nd Ed." published by SUN. I am using sdk1.31 (and have also tried sdk1.4) with Microsoft Access 2000. The demo program I am working with is trying to update a ResultSet programmatically using updateXXX().
    scrolling and row deletion using rs.delete() are ok.
    Here are my connection statements:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              connection = DriverManager.getConnection(sourceURL);
              statement = connection.createStatement(     ResultSet.TYPE_SCROLL_SENSITIVE,
                                                                ResultSet.CONCUR_UPDATABLE);

  • How to change the text in the legend of a graph programmat​ically in labview

    I have many graphs in one plot and want to show the legend the name of the graph (i.e. the filename). How do I change the text in the legend programmatically?

    Create a property node for your graph. Use the property node "Active Plot" to define which plot (or line) you want to rename. Then write the new legend label to the property node "Plot.Name". See attached.
    Tim
    Attachments:
    legend.vi ‏12 KB

  • How to set different view parameter programmatically in the same task flow

    Hello everyone,
    I have a view activity A that calls another view activity B with a link. In this link the action is set to a method (I use JSFUtils class: http://jdeveloper-adf.googlecode.com/svn/trunk/TGPrototype2/ViewController/src/com/tgslc/defaultManagement/utils/JSFUtils.java):
    public String goToB() {
    String paramToPass = "someParameterTakenInSomeWay";
    JSFUtils.setExpressionValue("#{pathToViewB_pageBPageDef.paramName}",paramToPass);
    return "openActivityB";
    where openActivityB is the control flow case to call B.
    In the B pageDef file I have set a parameter "paramName" without any value:
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="11.1.1.59.23" id="pageBPageDef">
    <parameters>
    <parameter id="paramName"
    value=""/>
    </parameters>
    <executables/>
    <bindings/>
    </pageDefinition>
    But at running time I have a oracle.jbo.expr.JIEvalException:
    JBO-25077: Name paramName not found in the specified object: pathToViewB_pageBPageDef.
    The question is: how can I set the parameter programmatically from the view activity A?
    Note that I use this method to set the parameter because in the real application I have many "view activity A" that will call B, but all of these have to set this parameter.
    I use JDeveloper 11.1.1.4.
    Thanks in advance,
    Baduel

    Hi,
    this is because PageDef B represents a binding container that is not active to the time you try to call it. The binding container becomes available when navigating to the page but not before. Instead:
    1. define a managed bean in pageFlowScope and expose a setter/getter method to hold the value to pass on
    2. Reference the managed bean in pageFlowScope from the attributebinding NDValue property using EL
    3. Set the managed bean value before navigating to view B
    Frank

  • How can I supress a Windows dialog box programmatically in LabView?

    I am trying to automatically supress or close a windows dialog box that appears when a LabView program crashes. I have a restart program that will automatically reopen the program and I don't want to have to click on the program error window that results from the crash. Does anyone know how to do this?
    Thanks so much for your time!

    The program rarely crashes - it is running in the background for the entire day and we just want to ensure that it is monitored and restarted in case of a crash. We also don't want the user to be bothered with the program error messagebox that pops up saying that an error log is being created. The program crashes when too many programs are running at the same time - so the problem isn't a huge one. I was just wondering if it was possible to stop this program error message from appearing by programmatically selecting the okay button or by suppressing the message entirely?

Maybe you are looking for

  • Visually impaired - Wish to change background colors ...

    Hi, What I wish to do sounds simple to me, yet I cannot see a way to do it. I want the title bar to be white with black text, or it could be dark blue with bold white text, either would work fine. I want the menu bars to be on a white background. I w

  • Adobe EchoSign May Release

    In the May release we have completed work on the new e-sign experience to address majority of the existing e-sign scenarios. The new e-sign experience will be the default experience for all new users. We will be turning it ON by default for all FREE

  • Please help me debug this program unit!!!!!

    dear sir, i tried diligently to find and to debug this tiny program unit,although my observation to the coding rules of the packages ,compilation error still occur. therefore,kindly i'm asking you sir to learn me how to correct it. thank you. create

  • CORBA  BAD_PARAM/201

    Hi I'm having difficulty passing info from my server to my client; primitive data types are no problem, but am not successful in implementing arrays. A video file is read into an array in the Server, and upon request from the Client, the Server attem

  • Backup and recovery tablespace.

    Hi all, one is production server and second one is totally fresh server. I had created database manually. We are migrating the database from hpux to hpux but from one server which is in boston and second server is on chicago. which is the fast way to