Handle Stale data with ToplLink

Hello,
I try to implement cache policy on my Toplink 10.1.3 app.
The main issue is that I have some tables that are updated by another application. I would like to use a cache with those tables because there are not updated often. But when they are updated, the cache must be refreshed.
I've tried to configure the following caching policy in my descriptor without any success:
Optimistic Locking:
Version locking on a DATE field
Store version in cache: false
Caching:
Type: Weak identity map / Soft subcache
invalidation-policy: No expiry
only-refresh-cache-if-newer-version
Shared cache
Coordination: change-set-with-new-objects
Any idea?

Marking the descriptor as isolated, means you will have no shared (ServerSession) cache.
Each ClientSession or UnitOfWork will have its own local cache and read directly from the database, not from the ServerSession IdentityMap.
If you use a ClientSession or UnitOfWork per request or per transaction, then you will always have fresh data, and will not need to call refresh.
For always-refresh, you will not be disabling the ServerSession cache, there will still be a cache, you will just be refreshing it every time you read and object. This is not the recommend approach, isolating the descriptor is the recommended approach. However, 10.1.3 is a very old version, and the first release of the isolated cache support. Previously to 10.1.3 always-refresh was the solution to avoiding stale data.

Similar Messages

  • Handle Session data with JAX-WS web services

    Is it posible to to handle session tracking with JAX-WS web services without implementing my own session logic.
    If posible how do we put values in to session and get them back.
    And also assuming that sessions are supported is it posible to share the same session between two web services on the same web application.

    Hello!
    Do you have any solution to your problem now? I also need to maintain a session bean between 2 webservices. If you solved this, can you please tell me how?
    Thanks a lot!

  • How to handle blob data with java and mysql and hibernate

    Dear all,
    I am using java 1.6 and mysql 5.5 and hibernate 3.0 . Some time i use blob data type . Earlier my project's data base was oracle 10g but now i am converting it to Mysql and now i am facing problem to save and fetch blob data to mysql database . Can anybody give me the source code for blob handling with java+Mysql+Hibernate
    now my code is :--
    ==================================================
    *.hbm.xml :--
    <property name="image" column="IMAGE" type="com.shrisure.server.usertype.BinaryBlobType" insert="true" update="true" lazy="false"/>
    ===================================================
    *.java :--
    package com.shrisure.server.usertype;
    import java.io.OutputStream;
    import java.io.Serializable;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Types;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.BLOB;
    import org.hibernate.HibernateException;
    import org.hibernate.usertype.UserType;
    import org.jboss.resource.adapter.jdbc.WrappedConnection;
    import com.google.gwt.user.client.rpc.IsSerializable;
    public class BinaryBlobType implements UserType, java.io.Serializable, IsSerializable {
    private static final long serialVersionUID = 1111222233331231L;
    public int[] sqlTypes() {
    return new int[] { Types.BLOB };
    public Class returnedClass() {
    return byte[].class;
    public boolean equals(Object x, Object y) {
    return (x == y) || (x != null && y != null && java.util.Arrays.equals((byte[]) x, (byte[]) y));
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
    BLOB tempBlob = null;
    WrappedConnection wc = null;
    try {
    if (value != null) {
    Connection oracleConnection = st.getConnection();
    if (oracleConnection instanceof oracle.jdbc.driver.OracleConnection) {
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    if (oracleConnection instanceof org.jboss.resource.adapter.jdbc.WrappedConnection) {
    InitialContext ctx = new InitialContext();
    DataSource dataSource = (DataSource) ctx.lookup("java:/DefaultDS");
    Connection dsConn = dataSource.getConnection();
    wc = (WrappedConnection) dsConn;
    // with getUnderlying connection method , cast it to Oracle
    // Connection
    oracleConnection = wc.getUnderlyingConnection();
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    tempBlob.open(BLOB.MODE_READWRITE);
    OutputStream tempBlobWriter = tempBlob.getBinaryOutputStream();// setBinaryStream(1);
    tempBlobWriter.write((byte[]) value);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    tempBlob.close();
    st.setBlob(index, tempBlob);
    } else {
    st.setBlob(index, BLOB.empty_lob());
    } catch (Exception exp) {
    if (tempBlob != null) {
    tempBlob.freeTemporary();
    exp.printStackTrace();
    st.setBlob(index, BLOB.empty_lob());
    // throw new RuntimeException();
    } finally {
    if (wc != null) {
    wc.close();
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
    final Blob blob = rs.getBlob(names[0]);
    return blob != null ? blob.getBytes(1, (int) blob.length()) : null;
    public Object deepCopy(Object value) {
    if (value == null)
    return null;
    byte[] bytes = (byte[]) value;
    byte[] result = new byte[bytes.length];
    System.arraycopy(bytes, 0, result, 0, bytes.length);
    return result;
    public boolean isMutable() {
    return true;
    public Object assemble(Serializable arg0, Object arg1) throws HibernateException {
    return assemble(arg0, arg1);
    public Serializable disassemble(Object arg0) throws HibernateException {
    return disassemble(arg0);
    public int hashCode(Object arg0) throws HibernateException {
    return hashCode();
    public Object replace(Object arg0, Object arg1, Object arg2) throws HibernateException {
    return replace(arg0, arg1, arg2);
    =================================================================
    can anyone give me the source code for this BinaryBlobType.java according to mysql blob handling ..

    Moderator action: crosspost deleted.

  • How can I handle no data with popup and email??

    Hello Experts,
    Can I do the following in VC 7.0?
    If the user searches for data and the data doesnt exist, then I want to create a popup asking if the user wants to create the data? If they say Yes, then I want to send the data they fill in to an email address. Is this possible?
    Thanks
    M

    Hi,
    Create a form to ask for 'Yes' or 'No' conformation and set its visibility based on the existence of the search data(use IF condition). Set the action of 'Yes' button as hyperlink and set the url as the emailid which one you want to send the data.
    Regards
    Basheer

  • Several Issue: Stale Data Error with 2 pages opened at same time

    Hello Gurus,
    I developed an OAF page to create and also update records. My page, depending from the operation, can show the data on fields, for update, or blank, on case to create records. This page contains one LOV field, input fields and textarea field to get the data.
    When i try record or update using one page per time, the LOV field works fine and records are uptodated with success.
    But if i use 2 pages or more in these situations:
    - one page is opened in update operation;
    - another page to create a new record.
    Issue: When i click to change the LOV field value on create page, or update page, the Lov pop-up is opened with success, but when i click in another value, i get this error below. Any action also can cause this error, like click on Back Button (with name 'Voltar', created by me). Please see the error below:
    Error: Stale Data*
    The requested page contains stale data.*
    This error could have been caused through the use of the browser's navigation*
    buttons (the browser Back button, for example).*
    Cause:*
    The view object XXXAM.XXXVO1 contained no record.*
    The displayed records may have been deleted, or the current record for the view*
    object may not have been properly initialized.*
    This error hapens when i open 2 pages on update operation mode also.
    This error dont hapens only when i open 2 pages on create operation mode.
    Ps:
    Note: I have an ApplicationModule (AM) for LOV and another AM for this page, but i used this other AM to another page too and VOs. Have any problem on this???
    To help to understand, i printed my page, u can see the screenshots on links below:
    http://imageshack.us/a/img850/9186/printforum1.png
    http://imageshack.us/a/img197/2185/printforum2.png
    I´ll print some code blocks and if u need know more code blocks, please tell me:
    My PageCO Controller, at processFormRequest, code to define update or create Operation:
    +if (row.getNewRowState() == Row.STATUS_NEW) {+
    operationType = createOperation;
    +} else {+
    operationType = updateOperation;
    +}+
    My Controller, at processRequest, update or create operation:
    +if (!pageContext.isFormSubmission()) {+
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    String reqHeaderId =
    pageContext.getParameter("requisitionHeaderId");
    +Serializable[] params = {reqHeaderId};+
    IcxReceivingAlreadyExistsVOImpl receivingExistsVO = (IcxReceivingAlreadyExistsVOImpl)am.findViewObject("IcxReceivingAlreadyExistsVO1");
    receivingExistsVO.initQuery(reqHeaderId);
    +if (receivingExistsVO.hasNext()) {+
    TransactionUnitHelper.startTransactionUnit(pageContext, UPDATE_RECEIVER_TRX);
    am.invokeMethod("initPersonQuery", params);
    +} else {+
    TransactionUnitHelper.startTransactionUnit(pageContext, CREATE_RECEIVER_TRX);
    am.invokeMethod("createReceivingPerson", params);
    +}+
    +}+
    My AMImpl.java :
    +public void createReceivingPerson(String reqHeaderId) {+
    OAViewObject vo = getIcxReceivingPersonVO1();
    +if (!vo.isPreparedForExecution()) {+
    vo.executeQuery();
    +}+
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    row.setAttribute("RequisitionHeaderId", reqHeaderId);
    +}+
    +public void initPersonQuery(String reqHeaderId) {+
    IcxReceivingPersonVOImpl vo = getIcxReceivingPersonVO1();
    +if (vo == null) {+
    +MessageToken[] errTokens = { new MessageToken("OBJECT_NAME", "IcxReceivingPersonVO1")};+
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    +}+
    vo.initQuery(reqHeaderId);
    +}+
    +public void apply() {+
    getTransaction().commit();
    +}+
    +public void rollback(){+
    Transaction txn = getTransaction();
    +if (txn.isDirty()) {+
    txn.rollback();
    +}+
    +}+
    In the hope of a solution, waiting for ur precious help, Gurus
    My true thanks since now,
    Best Regards,
    Alberto Bogéa

    Hi,
    Can you please tell, if you are using the same EO/VO combination for both the operation - Insert and Update on both screens.
    Quite possible, that when you open two screen in say Update Mode and you open the two List Of Values, then as soon as you have selected the value in one of the LOV, the Other LOV will throw you stale data as the same VO/EO is being used.
    Try using two different EOs/VOs combination and see if that helps.
    Regards,
    Saurabh Agrawal

  • Error handling for master data with direct update

    Hi guys,
    For master data with flexible update, error handling can be defined in InfoPackege, and if the load is performed via PSA there are several options - clear so far. But what about direct update...
    But my specific question is: If an erroneous record (e.g invalid characters) occur in a master data load using direct update, this will set the request to red. But what does this mean in terms of what happens to the other records of the request (which are correct) are they written to the master data tables, so that they can be present once the masterdata is activated, or are nothing written to masterdata tables if a single record is erroneous???
    Many thanks,
    / Christian

    Hi Christian -
    Difference between flexible upload & Direct upload is that direct upload does not have Update Rules, direct upload will have PSA as usual & you can do testing in PSA.
    second part when you load master data - if error occurs all the records for that request no will be status error so activation will not have any impact on it i.e. no new records from failed load will be available.
    hope it helps
    regards
    Vikash

  • Can my 600MHz P-3, 256MB Ram handle a data acquisition of more than 1kHz with waveform chart support?

    please suggest tools for acquiring high speed 8 analog channel data.
    can my 600MHz P-3, 256MB Ram handle a data acquisition of more than 1kHz with waveform chart support?

    Arun,
    I have performed data acquisition on a computer with lower specs than the one you described, at rates greater than 1 kHz. I don't quite understand the "waveform chart support" portion of your question, but if you are asking if it is possible to plot the acquired data on a Waveform Chart in LabVIEW, this should not be a problem.
    If you have more specific questions, let me know.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Stale data error while deleting a record

    Hi
    My design of this development is as follow...
    1. Search Page in which users give some search criteria and results will be displayed in the results region on the same page. For each results record I have two buttons like 'Update' and 'Delete' so that users can delete the record or can update the record. For update i created a one more page where users can able to edit and save the data. I have two AM one for Search Page and one for Update Page.
    Please find more details below.
    intfEO  based on PO_REQUISITIONS_INTERFACE_ALL
    errorEO  based on PO_INTERFACE_ERRORS
    updateEO based on PO_REQUISITIONS_INTERFACE_ALL
    VOs
    intfVO based on intfEO and errorEO
    updateVO based on updateEO
    AM
    intfAM based on intfVO
    updateAM based on updateVO
    Pages
    searchPG based on intfAM
    updatePG based on updateAM
    Suppose I have one record in interface table with corresponding error record in error table.When users given the search criteria and hit enter they found a record. It means i have one record in the interface having one error record in the error table and both tables have same transaction id (primary key). So here user first try to update the record and it is working. After update he try to delete a record then I am getting below error. Please note that I am not getting this error when if i directly delete the record with out doing any update before delete. When ever users click on update icon then update PG will open and when users click on Apply button then data is getting updated in the database and page will forward to the search page.
    Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    My UpdatePage Controller
    /*===========================================================================+
    |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
    |                         All rights reserved.                              |
    +===========================================================================+
    |  HISTORY                                                                  |
    +===========================================================================*/
    package powl.oracle.apps.xxpowl.po.requisition.webui;
    import com.sun.java.util.collections.HashMap;
    import com.sun.rowset.internal.Row;
    import java.io.Serializable;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageDateFieldBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    //import oracle.apps.fnd.oam.diagnostics.report.Row;
    import oracle.apps.icx.por.common.webui.ClientUtil;
    import powl.oracle.apps.xxpowl.po.requisition.server.xxpowlPOReqIntfUpdateAMImpl;
    import powl.oracle.apps.xxpowl.po.requisition.server.xxpowlPOReqIntfUpdateEOVOImpl;
    * Controller for ...
    public class xxpowlPOReqIntfAllUpdatePageCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
         xxpowlPOReqIntfUpdateAMImpl am = (xxpowlPOReqIntfUpdateAMImpl)pageContext.getApplicationModule(webBean);
          xxpowlPOReqIntfUpdateEOVOImpl UpdateVO =(xxpowlPOReqIntfUpdateEOVOImpl)am.findViewObject("xxpowlPOReqIntfUpdateEOVOImpl");
          String newvalue = (String)pageContext.getSessionValue("testValue");     
          System.out.println("Transaction ID from processRequest UpdateCO from testValue field:"+newvalue);
          String transactionid = pageContext.getParameter("HashmapTransacitonid");
          System.out.println("Transaction ID from processRequest Hash Map in UpdateCO :"+transactionid);
          String errorcolumn = pageContext.getParameter("HashmapErrorcolumn");
          System.out.println("Error Column Name from processRequest Hash Map in UpdateCO :"+errorcolumn);
          String errormsg = pageContext.getParameter("HashmapErrormessage");
          System.out.println("Error Message from processRequest Hash Map in UpdateCO :"+errormsg);
          String readyonly = pageContext.getParameter("HashmapReadonly");
          System.out.println("Read Only value from processRequest Hash Map in UpdateCO :"+readyonly);
          if (transactionid !=null & !"".equals(transactionid)) { 
         /* Passing below four parameters to the Update Page */
          Serializable amParams[] = new Serializable[]{transactionid,readyonly,errorcolumn,errormsg} ;
          pageContext.getRootApplicationModule().invokeMethod("executexxpowlPOReqIntfUpdateEOVO", amParams);
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);      
         OAApplicationModule am = pageContext.getApplicationModule(webBean);
          if (pageContext.getParameter("ApplyButton") != null)
            System.out.println("Inside ApplyButton method in UpdatePageCO");
            OAViewObject vo = (OAViewObject)am.findViewObject("xxpowlPOReqIntfUpdateEOVO");
            String transactionid = pageContext.getParameter("HashmapTransacitonid");
            System.out.println("Transaction ID from processFormRequest Hash Map in UpdateCO-ApplyButton method :"+transactionid);
            am.invokeMethod("apply");
              pageContext.forwardImmediately("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllPG",
                                                     null,
                                                     OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                     null,
                                                     null,
                                                     true,
                                                     OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
           else if (pageContext.getParameter("CancelButton") != null)
            am.invokeMethod("rollback");
            pageContext.forwardImmediately("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllPG",
                                                   null,
                                                   OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                   null,
                                                   null,
                                                   true,
                                                   OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    UpdatePageAMImpl.java
    package powl.oracle.apps.xxpowl.po.requisition.server;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OARow;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.inv.appsphor.order.server.XxapOrderHeaderVOImpl;
    import oracle.jbo.Transaction;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class xxpowlPOReqIntfUpdateAMImpl extends OAApplicationModuleImpl {
        /**This is the default constructor (do not remove)
        public xxpowlPOReqIntfUpdateAMImpl() {
        /**Container's getter for xxpowlPOReqIntfUpdateEOVO
        public xxpowlPOReqIntfUpdateEOVOImpl getxxpowlPOReqIntfUpdateEOVO() {
            return (xxpowlPOReqIntfUpdateEOVOImpl)findViewObject("xxpowlPOReqIntfUpdateEOVO");
        /**Sample main for debugging Business Components code using the tester.
        public static void main(String[] args) {
            launchTester("powl.oracle.apps.xxpowl.po.requisition.server", /* package name */
          "xxpowlPOReqIntfUpdateAMLocal" /* Configuration Name */);
    /*  // Added by 
        public void execute_update_query(String TransactionID) {
        xxpowlPOReqIntfUpdateEOVOImpl vo = getxxpowlPOReqIntfUpdateEOVO();
        vo.initQuery(TransactionID);
    // Added by  , this will not call bec changed the logic and so now the update button enabled on search results page
    // and this method will not called
    public void pageInEditMode (String transactionID, String readOnlyFlag, String ErrorColumn,
                                                                           String ErrorMessage)
        System.out.println("Transaction Id from pageInEditMode in UpdatePGAMImpl.java: "+transactionID);
        System.out.println("xxReadOnly from pageInEditMode in UpdatePGAMImpl.java: "+readOnlyFlag);
        // Get the VO
        xxpowlPOReqIntfUpdateEOVOImpl updateVO = getxxpowlPOReqIntfUpdateEOVO();
        //Remove the where clause that was added in the previous run
        updateVO.setWhereClause(null);
        //Remove the bind parameters that were added in the previous run.
        updateVO.setWhereClauseParams(null);
        //Add where clause
        // updateVO.addWhereClause(" TRANSACTION_ID = :1 ");
        //Bind transactionid to the where clause.
         // updateVO.setWhereClauseParam(1, transactionID); // this will not work bec it will start with zero from from 1
          updateVO.setWhereClauseParam(0, transactionID);
        //Execute the query.
        updateVO.executeQuery();
        xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
        // Assiging the transient varaibles
        currentRow.setxxErrorMessage(ErrorMessage);
        currentRow.setxxErrorColumn(ErrorColumn);
        if ("N".equals(readOnlyFlag))
              /* Make the attribute to 'False so that all fields will be displayed in Edit Mode because we used this
               xxReadOnly as SPEL  */
               currentRow.setxxReadOnly(Boolean.FALSE);
       public void executexxpowlPOReqIntfUpdateEOVO(String transactionID, String xxReadyOnly, String ErrorColumn,
                                                                                              String ErrorMessage)
           System.out.println("Transaction Id from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+transactionID);
           System.out.println("xxReadOnly from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+xxReadyOnly);
           System.out.println("Error Message from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+ErrorColumn);
           System.out.println("Error Column from executexxpowlPOReqIntfUpdateEOVO in UpdatePGAMImpl.java: "+ErrorMessage);
         // Get the VO
         xxpowlPOReqIntfUpdateEOVOImpl updateVO = getxxpowlPOReqIntfUpdateEOVO();
         //xxpowlPOReqIntfUpdateEOVORowImpl updaterowVO = xxpowlPOReqIntfUpdateEOVO();
       //not working
       //    OARow row = (OARow)updateVO.getCurrentRow();
       //    row.setAttribute("xxReadOnly", Boolean.TRUE);
    // updateVO.putTransientValue('XXXXX',x);
         //Remove the where clause that was added in the previous run
         updateVO.setWhereClause(null);
         //Remove the bind parameters that were added in the previous run.
         updateVO.setWhereClauseParams(null);
         //Add where clause
         // updateVO.addWhereClause(" TRANSACTION_ID = :1 ");
         //Bind transactionid to the where clause.
          // updateVO.setWhereClauseParam(1, transactionID); // this will not work bec it will start with zero from from 1
           updateVO.setWhereClauseParam(0, transactionID);
        // updateVO.setWhereClauseParam(1, ErorrColumn); 
         //Execute the query.
         updateVO.executeQuery();
         /* We want the page should be read only initially so after executing the VO with above command
            and if you use next() it will go to the first record among the
            fetched records. If you want to iterate for all the records then use iterator */
            /* Using Iterator
             while(updateVO.hasNext()) {  // this will check after execute Query above command if it has any rows
              xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
              /* above line next() will take the control of the first record */
          /*     currentRow.setxxErrorMessage(ErrorMessage);
                 currentRow.setxxErrorColumn(ErrorColumn);
               if ("Y".equals(xxReadyOnly))
                      currentRow.setxxReadOnly(Boolean.TRUE);                 
             } // this while loop will loop till end of all the fetched records
         xxpowlPOReqIntfUpdateEOVORowImpl currentRow = (xxpowlPOReqIntfUpdateEOVORowImpl)updateVO.next();
      // Assiging the transient varaibles
      currentRow.setxxErrorMessage(ErrorMessage);
      currentRow.setxxErrorColumn(ErrorColumn);
        /* Make the attribute to 'TRUE' so that all fields will be displayed as READ ONLY because we used this
           xxReadOnly as SPEL
           if ("Y".equals(xxReadyOnly))
                  currentRow.setxxReadOnly(Boolean.TRUE);            
      //Added by  and this methiod will get called from UpdatePG Process Form Request controller  
         public void rollback()
           Transaction txn = getTransaction();
           if (txn.isDirty())
             txn.rollback();
        public void apply()
            //OAViewObject vo1 = (OAViewObject)getxxpowlPOReqIntfUpdateEOVO();
            //Number chargeAccountID = vo1.get
          getTransaction().commit();      
          OAViewObject vo = (OAViewObject)getxxpowlPOReqIntfUpdateEOVO();
          if (!vo.isPreparedForExecution())
           vo.executeQuery();
    SearchPG AM
    package powl.oracle.apps.xxpowl.po.requisition.server;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.jbo.RowSetIterator;
    import oracle.jbo.Transaction;
    import oracle.jbo.domain.Number;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlErrosLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlInterfaceSouceCodeLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlItemSegment1LovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlOrgLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlReferenceNumberLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlRequestIdLovVOImpl;
    import powl.oracle.apps.xxpowl.po.requisition.lov.server.xxpowlRequisitionTypeLovVOImpl;
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    public class xxpowlPOReqIntfAllAMImpl extends OAApplicationModuleImpl {
        /**This is the default constructor (do not remove)
        public xxpowlPOReqIntfAllAMImpl() {
        /**Container's getter for xxpowlPOReqIntfAllVO
        public xxpowlPOReqIntfAllVOImpl getxxpowlPOReqIntfAllVO() {
            return (xxpowlPOReqIntfAllVOImpl)findViewObject("xxpowlPOReqIntfAllVO");
        /**Sample main for debugging Business Components code using the tester.
        public static void main(String[] args) {
            launchTester("powl.oracle.apps.xxpowl.po.requisition.server", /* package name */
          "xxpowlPOReqIntfAllAMLocal" /* Configuration Name */);
        /**Container's getter for xxpowlRequestIdLovVO
        public xxpowlRequestIdLovVOImpl getxxpowlRequestIdLovVO() {
            return (xxpowlRequestIdLovVOImpl)findViewObject("xxpowlRequestIdLovVO");
        /**Container's getter for xxpowlErrosLovVO
        public xxpowlErrosLovVOImpl getxxpowlErrosLovVO() {
            return (xxpowlErrosLovVOImpl)findViewObject("xxpowlErrosLovVO");
        /**Container's getter for xxpowlOrgLovVO
        public xxpowlOrgLovVOImpl getxxpowlOrgLovVO() {
            return (xxpowlOrgLovVOImpl)findViewObject("xxpowlOrgLovVO");
      //Start Adding by Lokesh
      //This method wil get invoked from the search results page Process Request
       public void rollbackItem()
         Transaction txn = getTransaction();
         if (txn.isDirty())
           txn.rollback();
      //This method will invoked from Controller page when user click Yes on delete confirmtion page from Search Results Page
       public void deleteItem(String trasnsactionID)
         Number rowToDelete = new Number(Integer.parseInt(trasnsactionID));      
         OAViewObject vo = (OAViewObject)getxxpowlPOReqIntfAllVO();
         xxpowlPOReqIntfAllVORowImpl row = null;
         int fetchedRowCount = vo.getFetchedRowCount();
       //  System.out.print(fetchedRowCount);
         System.out.println("No of row fetched on delete method :"+fetchedRowCount);
         RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
           System.out.println("1 :");
         if (fetchedRowCount > 0)
             System.out.println("2 :");
           deleteIter.setRangeStart(0);
             System.out.println("3 :");
           deleteIter.setRangeSize(fetchedRowCount);
             System.out.println("4 :");
           for (int i = 0; i < fetchedRowCount; i++)
               System.out.println("5 :");
             row = (xxpowlPOReqIntfAllVORowImpl)deleteIter.getRowAtRangeIndex(i);
               System.out.println("6 :");
             Number PK = row.getTransactionId();
               System.out.println("7 :");
             if (PK.compareTo(rowToDelete) == 0)
                 System.out.println("8 :");
               row.remove();
                 System.out.println("9 :");
               getTransaction().commit();
                 System.out.println("10 :");
               break;
                 //System.out.println("11 :");
           System.out.println("11 :");
         deleteIter.closeRowSetIterator();
           System.out.println("12 :");
        /**Container's getter for xxpowlInterfaceSouceCodeLovVO
        public xxpowlInterfaceSouceCodeLovVOImpl getxxpowlInterfaceSouceCodeLovVO() {
            return (xxpowlInterfaceSouceCodeLovVOImpl)findViewObject("xxpowlInterfaceSouceCodeLovVO");
        /**Container's getter for xxpowlRequisitionTypeLovVO
        public xxpowlRequisitionTypeLovVOImpl getxxpowlRequisitionTypeLovVO() {
            return (xxpowlRequisitionTypeLovVOImpl)findViewObject("xxpowlRequisitionTypeLovVO");
        /**Container's getter for xxpowlReferenceNumberLovVO
        public xxpowlReferenceNumberLovVOImpl getxxpowlReferenceNumberLovVO() {
            return (xxpowlReferenceNumberLovVOImpl)findViewObject("xxpowlReferenceNumberLovVO");
        /**Container's getter for xxpowlItemSegment1LovVO
        public xxpowlItemSegment1LovVOImpl getxxpowlItemSegment1LovVO() {
            return (xxpowlItemSegment1LovVOImpl)findViewObject("xxpowlItemSegment1LovVO");
    Search Page Controller
    /*===========================================================================+
    |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
    |                         All rights reserved.                              |
    +===========================================================================+
    |  HISTORY                                                                  |
    +===========================================================================*/
    package powl.oracle.apps.xxpowl.po.requisition.webui;
    import com.sun.java.util.collections.HashMap;
    //import com.sun.java.util.collections.Hashtable;
    import java.util.Hashtable;
    //import java.util.HashMap;
    import java.io.Serializable;
    import javax.servlet.jsp.PageContext;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    * Controller for ...
    public class xxpowlPOReqIntfAllSearchPageCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
        //Added by Lokesh
          OAApplicationModule am = pageContext.getApplicationModule(webBean);
         if (TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "updateRecord", false)) {
               am.invokeMethod("rollbackItem");
               TransactionUnitHelper.endTransactionUnit(pageContext, "updateRecord");
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);
             String userClicked = pageContext.getParameter("event");
             System.out.println("Event from processFormRequest in SearchPageCO :"+userClicked);
           System.out.println("Parametere Names are :- \t" + pageContext.getParameter("UpdateImage"));
           System.out.println("Parametere Names are :- \t" + pageContext.getParameter("event"));
         if (pageContext.getParameter("event") != null &&
             pageContext.getParameter("event").equalsIgnoreCase("Update")) { 
             String ReqTransactionId=(String)pageContext.getParameter("transacitonidParam");
             String errorcolumn=(String)pageContext.getParameter("errorcolumnParam");
             String errormsg=(String)pageContext.getParameter("errormessageParam");
             String readyonly="Y"; //(String)pageContext.getParameter("readonlyParam");
             System.out.println("Requisition Transaction Id  : "+ReqTransactionId);
             System.out.println("Error Column  : "+errorcolumn);
             System.out.println("Error Message  : "+errormsg);
             System.out.println("Read Only  : "+readyonly);
             HashMap params = new HashMap(4);
             params.put("HashmapTransacitonid",ReqTransactionId);
             params.put("HashmapErrorcolumn",errorcolumn);
             params.put("HashmapErrormessage",errormsg);
             params.put("HashmapReadonly",readyonly);
             pageContext.putSessionValue("testValue",ReqTransactionId);
             //System.out.println("Transaction Id passing through HashMap :- \t" + ReqTransactionId);
             pageContext.setForwardURL("OA.jsp?page=/powl/oracle/apps/xxpowl/po/requisition/webui/xxpowlPOReqIntfAllUpdatePG",
                                        null,
                                        OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                        null,
                                        params,
                                        true,
                                        OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
                                        OAWebBeanConstants.IGNORE_MESSAGES) ;   
    else if (pageContext.getParameter("event") != null &&
             pageContext.getParameter("event").equalsIgnoreCase("Delete")) {   
        System.out.println("Inside Delete method in SearchCO");
        String deleteTransactionID=(String)pageContext.getParameter("deleteTransactionIDParam");
        System.out.println("Transaction Id in Delete Method :- \t" + deleteTransactionID);
      //  deleteTransactionID ="";  //Makeing Null because dont want to show the transaction id bec users dont know about it
        //MessageToken[] tokens = { new MessageToken("MESSAGE_NAME", deleteTransactionID) };
        MessageToken[] tokens = { new MessageToken("MESSAGE_NAME", "") };
        OAException mainMessage = new OAException("FND", "FND_MESSAGE_DELETE_WARNING", tokens);
        OADialogPage dialogPage = new OADialogPage(OAException.WARNING,mainMessage, null, "", "");
        String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
        String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
        dialogPage.setOkButtonItemName("DeleteYesButton");
        dialogPage.setOkButtonToPost(true);
        dialogPage.setNoButtonToPost(true);
        dialogPage.setPostToCallingPage(true);
        dialogPage.setOkButtonLabel(yes);
        dialogPage.setNoButtonLabel(no);
        Hashtable formParams = new Hashtable(1);
        formParams.put("transactionIdDeleted", deleteTransactionID);
        dialogPage.setFormP

    Hi friend ,
    In Search page i didn't do any update. and also search page is not a problem it's working fine. create page only the problem. In this page only throwing Stale data error exception.
    Please give me more suggestion.
    Thanks in advance,

  • Unable to resolve stale data error in parent-child page structure.

    Hi Experts!
    I've got a master-detail page which consists of two VOs(EO based), Lets say
    1. MasterTableVO
    2. DetailTableVO
    This page contains two page buttons "Cancel" and "Apply" till here it works all fine & perfect[by that i mean creating, retrieving, querying etc etc.]
    But now i've created another page which is actually a child page of the above mentioned one.
    Here the user'll enter to view some default configured financial info or may also update the default settings manually.
    In this page, I've got only an advancedTable based on a VO(EO based), lets say
    3. PaymentsTableVO
    This page has only one page button "Ok" and which returns back to the parent page retaining the AM.
    All the three VOs are in the same AM. Functionally untill here also it looks fine, but when i finally apply the data it throws an error on getTransaction().commit();
    Error stack:
    OAF Error Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    Plz reply ASAP.
    Regards
    Ari

    Hi Sushant,
    Yepp !! I've done this in the AM. After invoking the method from the PGCO.
    Here's the code of the PGCO:
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package AmritTransportation.oracle.apps.po.Transportations.webui;
    import java.io.Serializable;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    * Controller for ...
    public class CostAllocationsPGCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isBackNavigationFired(false)) {
    TransactionUnitHelper.startTransactionUnit(pageContext,"CreateTxnCosts");
    if (!pageContext.isFormSubmission()) {
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAMessageTextInputBean Amount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Amount");
    String TransportationNum = (String)pageContext.getParameter("pTransportationNum")
    ,TransportationId = (String)pageContext.getParameter("pTransportationId")
    ,LockedFlag = (String)pageContext.getParameter("pLockedFlag")
    ,OrgId = (String)pageContext.getProfile("ORG_ID");
    Serializable[] param = {OrgId,TransportationId};
    if (LockedFlag.equals("N")) {
    am.invokeMethod("DefineDefaultCosts",param);
    else {
    am.invokeMethod("executeCosts",param);
    Amount.setReadOnly(true);
    else {
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"CreateTxnCosts",true)) {
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Ok") != null) {
    TransactionUnitHelper.endTransactionUnit(pageContext,"CreateTxnCosts");
    pageContext.forwardImmediately("OA.jsp?page=/AmritTransportation/oracle/apps/po/Transportations/webui/CreateTransportationPG&isChildPage=1"
    ,null
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null
    ,null
    ,true
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    ===============================================================
    Here's the AM method DefineDefaultCosts:
    ===============================================================
    /**Custom public method to define default cost
    * allocation based on the pre-defined formula
    * for cost allocation keeping parity with the
    * corresponding delivery freight details
    public void DefineDefaultCosts(String StrOrgId,String StrTransportationId) {
    OAViewObject vo = (OAViewObject)getAmritTransportationCreateVO1()
    ,vo1 = (OAViewObject)getAmritTransportationPaymentsVO1()
    ,vo2 = (OAViewObject)getAmritTransportDeliveryLinesVO1();
    OADBTransaction txn = getOADBTransaction();
    ArrayList debugMessage = new ArrayList();
    HashMap PartySet = new HashMap();
    Boolean PartyEntryValid = null;
    String TransportationNum = (String)vo.getCurrentRow().getAttribute("TransportationNum")
    ,CurrencyCode = (String)vo.getCurrentRow().getAttribute("CurrencyCode")
    ,EventType = "TRNSP DELIVERED",PeriodName = null;
    Date AccountingDate = (Date)vo.getCurrentRow().getAttribute("DateDelivered");
    Number Amount = (Number)vo.getCurrentRow().getAttribute("Amount")
    ,Rate = (Number)vo.getCurrentRow().getAttribute("Rate")
    ,TripId = (Number)vo.getCurrentRow().getAttribute("TripId")
    ,OrgId = null,TransportationId = null,CodeCombinationId = new Number(576773);
    int DlvryRowCount = vo2.getRowCount(),CostDistRowCount = vo1.getRowCount();
    if (CostDistRowCount == 0) {
    try {
    OrgId = new Number(StrOrgId);
    TransportationId = new Number(StrTransportationId);
    }catch (Exception e) {}
    //debugMessage.add(new OAException("Inherited Values: "+TransportationId+" "+TransportationNum+" "+CurrencyCode+" "+EventType+" "+AccountingDate+" "+Amount+" "+Rate+" "+OrgId));
    try {
    Connection Conn = txn.getJdbcConnection();
    String v$Script = "Select gp.period_name period\n" +
    "From gl_periods gp\n" +
    "Where upper(gp.period_set_name) = 'AMRIT_CALENDAR'\n" +
    "And gp.adjustment_period_flag = 'N'\n" +
    "And trunc(:1) between nvl(gp.start_date,trunc(sysdate))\n" +
    " and nvl(gp.end_date,trunc(sysdate))\n";
    PreparedStatement PreExecuteQuery = Conn.prepareStatement(v$Script);
    PreExecuteQuery.setDate(1,new java.sql.Date(AccountingDate.dateValue().getTime()));
    for (ResultSet QryOutputRS = PreExecuteQuery.executeQuery();QryOutputRS.next();) {
    PeriodName = QryOutputRS.getString("period");
    v$Script = "Select attl.vendor_id vendorid\n" +
    " ,asp.vendor_name vendor \n" +
    "From apps.amrit_transport_trips att\n" +
    " ,apps.amrit_transport_trip_lines attl\n" +
    " ,ap.ap_suppliers asp\n" +
    "Where att.org_id = :1\n" +
    "And att.trip_id = :2\n" +
    "And att.enabled_flag = 'Y'\n" +
    "And trunc(sysdate) between nvl(att.start_date_active,trunc(sysdate))\n" +
    " and nvl(att.end_date_active,trunc(sysdate))\n" +
    "And attl.org_id = att.org_id\n" +
    "And attl.trip_id = att.trip_id\n" +
    "And attl.enabled_flag = 'Y'\n" +
    "And trunc(sysdate) between nvl(attl.start_date_active,trunc(sysdate))\n" +
    " and nvl(attl.end_date_active,trunc(sysdate))\n" +
    "And attl.location_type = 'HZ'\n" +
    "And asp.enabled_flag = 'Y'\n" +
    "And asp.vendor_id = attl.vendor_id\n" +
    "And trunc(sysdate) between nvl(asp.start_date_active,trunc(sysdate))\n" +
    " and nvl(asp.end_date_active,trunc(sysdate))\n";
    PreExecuteQuery = Conn.prepareStatement(v$Script);
    PreExecuteQuery.setInt(1,Integer.parseInt(OrgId.toString()));
    PreExecuteQuery.setInt(2,Integer.parseInt(TripId.toString()));
    for (ResultSet QryOutputRS = PreExecuteQuery.executeQuery();QryOutputRS.next();) {
    PartySet.put(QryOutputRS.getString("vendorid"),QryOutputRS.getString("vendor"));
    }catch (Exception e) {}
    /* vo2.first();
    for (int i = 1;i <= DlvryRowCount;i++) {
    if (vo2.getCurrentRow().getAttribute("CancelFlag").equals("N")) {
    PartyEntryValid = PartySet.add((Number)vo2.getCurrentRow().getAttribute("VendorId"));
    //debugMessage.add(new OAException("Set VendorId: "+vo2.getCurrentRow().getAttribute("VendorId")));
    vo2.next();
    //debugMessage.add(new OAException("PartySet: "+PartySet.entrySet()));
    for (Iterator iter = PartySet.entrySet().iterator();iter.hasNext();) {
    Map.Entry entry = (Map.Entry)iter.next();
    String VendorName = (String)entry.getValue();
    Number Cost = null;
    int PartyId = Integer.parseInt(entry.getKey().toString());
    float Qty = 0;
    try {
    vo2.first();
    for (int i = 1;i <= DlvryRowCount;i++) {
    //debugMessage.add(new OAException("VO VendorId: "+vo2.getCurrentRow().getAttribute("VendorId")+" Cancelled: "+vo2.getCurrentRow().getAttribute("CancelFlag")));
    if (vo2.getCurrentRow().getAttribute("CancelFlag").equals("N")) {
    int VendorId = Integer.parseInt(vo2.getCurrentRow().getAttribute("VendorId").toString());
    float Quantity = Integer.parseInt(vo2.getCurrentRow().getAttribute("Quantity").toString());
    if (PartyId == VendorId) {
    Qty+= Quantity;
    //debugMessage.add(new OAException("Quantities: "+Quantity+" "+Qty));
    vo2.next();
    Qty*= Float.parseFloat(Rate.toString());
    Float totalQty = new Float(Qty);
    Cost = new Number(totalQty);
    }catch (Exception e) {}
    //debugMessage.add(new OAException("PartyId: "+PartyId+" VendorName: "+VendorName+" Cost: "+Cost+" EntryKey: "+entry.getKey()+" EntryValue: "+entry.getValue()));
    Row row = vo1.createRow();
    row.setAttribute("OrgId",OrgId);
    row.setAttribute("TransportationId",TransportationId);
    row.setAttribute("TransportationNum",TransportationNum);
    row.setAttribute("EventType",EventType);
    row.setAttribute("AccountingDate",AccountingDate);
    row.setAttribute("PeriodName",PeriodName);
    row.setAttribute("CodeCombinationId",CodeCombinationId);
    row.setAttribute("PartyId",PartyId);
    row.setAttribute("VendorName",VendorName);
    row.setAttribute("CurrencyCode",CurrencyCode);
    row.setAttribute("Amount",Cost);
    row.setAttribute("TransportationAmount",Amount);
    vo1.last();
    vo1.next();
    vo1.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    vo1.first();
    vo2.first();
    OAException.raiseBundledOAException(debugMessage);
    ===============================================================
    Here's the AM method executeCosts:
    ===============================================================
    /**Custom public method to execute the corresponding
    * transportation transactional cost allocations
    * and the distributive charges on the vendor accounts
    public void executeCosts(String StrOrgId,String StrTransportationId) {
    OAViewObject vo = (OAViewObject)getAmritTransportationPaymentsVO1();
    Number TransportationId = null;
    try { TransportationId = new Number(StrTransportationId); }catch (Exception e) {}
    if (!vo.isPreparedForExecution()) {
    if (TransportationId != null) {
    vo.setNamedWhereClauseParam("ReferredTransportationId",TransportationId);
    vo.executeQuery();
    ===============================================================
    Plz mention if something else is also required.
    Regards
    Ari :)

  • Browser Back Button x Stale Data

    Hi,
    I'm facing a weird issue with back button handling.. whenever two sessions of the browser are opened to access the Oracle Applications, when changing something in one session, moving to the other session to change another thing and come back to the first session, even for completely different products and responsibilities, it gives me the stale data error as below. It seems like the session has been invalidated since I'm sure I haven't use the browser back button.
    Is this an expected behavior?
    ++Error: Cannot Display Page++
    ++You cannot complete this task because you accessed this page using the browser's navigation buttons (the browser Back button, for example).++
    ++To proceed, please select the Home link at the top of the application page to return to the main menu. Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.++
    Thanks,
    Eduardo

    Yes,that is the expected behaviour. In oaf http session is synchronised with the clicks, so on same desktop if u open two different apps sessions you will face the error, which ur facing now.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Import data with nulls in Desktop Intelligence

    Hello,
    I have data with null values (in a measure).  If I export the data as CSV it shows null values as #EMPTY.  If I use that as a datasource, it loads #EMPTY as 0 (zero).
    Is there a way to make desktop intelligence recognize null values?  I tried to remove the #empty and just leave the column empty, it still loads as a numeric zero.
    Same (actually worse) for XML.  It seems if I export my data to XML it can not use that as a datasource.  Odd.  So I created the following XML file:
    <?xml version='1.0' encoding='UTF-8'?>
    <data>
      <item key="AAAAAEUK" value="130" category="A" />
      <item key="AAAACGDC" value="66" category="A" />
      <item key="AAAADNJP" value="56" category="A" />
      <item key="AAAAFWRQ" value="222" category="A" />
      <item key="AAAAGITU" category="B" />
    </data>
    I would expect the value field to be null for the last row.  But the values turns out to be 222!  If I try to put anything else, an empty string "", "#EMPTY", "null", it is always returned as 0.
    This is a problem because 0 an null are differnt when computing averages.

    Hi Florian,
    What is the source of your csv data?
    If I have a table in excel with empty cells, the data goes into the .csv as nothing so your example would look like
    Item key,value,category
    AAAAAEUK,130,A
    AAAACGDC,66,A
    AAAADNJP,56,A
    AAAAFWRQ,222,A
    AAAAGITU,,B
    This reads in just fine in DeskI (shows #EMPTY in the view data, treats it as such in the report).
    So I would look to get the data generated in right way, then DeskI can handle it, no problem.
    If all else fails, just run a search&replace and change ,#EMPTY, to ,,
    BTW if you have an alphanumeric value in a column where DeskI already decided there should be numeric,
    it will read in as 0, that is why the #EMPTY string value got transformed to zero.
    Good luck,
    Marianne

  • Dynamic SQL and Data with Single Quotes in it.

    Hi There,
    I have a problem in that I am using dynamic SQL and it happens that one of the columns does contain single quotes (') in it as part of the data. This causes the resultant dynamic SQL to get confused as the single quote that is part of the data is taken to mean end of sting, when in fact its part of the data. This leaves out a dangling single quote that was meant to enclose the string. Here is my dynamic SQL and the result of the parsed SQL that I have captured:
    ****Dynamic SQL*****
    l_sql:='select NOTE_TEMPLATE_ID '||
    'FROM TMP_NOTE_TEMPLATE_VALUES '||
    'where TRIM(LEGACY_NOTE_CODE)='''||trim(fp_note_code)||''' '||
    'and TRIM(DISPLAY_VALUE)='''||trim(fp_note_text)||''' ';
    execute immediate l_sql INTO l_note_template_id;
    Because the column DISPLAY_VALUE contains data with single quotes, the resultant SQL is:
    ******PARSED SQL************
    select NOTE_TEMPLATE_ID
    FROM TMP_NOTE_TEMPLATE_VALUES
    where TRIM(LEGACY_NOTE_CODE)='INQ' and TRIM(DISPLAY_VALUE)='Cont'd'
    And the problem lies with the single quote between teh characters t and d in the data field for DISPLAY_ITEM. How can I handle this?
    Many thanks,

    I have been reliably informed that if one doesn't enclose char/varchar2 data items in quotes, the right indices may not be usedI am into oracle for past 4 years and for the first time i am hearing this.
    Your reliable source is just wrong. Bind variables are variables that store your value and which are used in SQL. They are the proper way to use values in your SQL. By default all variables in PL/SQL is bind variable.
    When you can do some thing in just straight SQL just do it. Dynamic SQL does not make any sense to me here.
    Thanks,
    Karthick.

  • SYSTEM_NO_ROLL dump when trying to precalculate data with RSRD_BROADCAST_PR

    Dear all,
    At my present customer we are facing a problem when doing a precalculate of data with RSRD_BROADCAST_PROCESSOR.
    The dump message is:
    Runtime Errors                                                       SYSTEM_NO_ROLL                    
    Date and Time                                                       20.08.2008                    3:20:54
         Short text                                                                      
                   Unable to fulfil request for 1082885568 bytes of memory space.                                                            
         What happened?                                                                      
                   Each transaction requires some main memory space to process                                                            
                   application data. If the operating system cannot provide any more                                                            
                   space, the transaction is terminated.                                                            
         What can you do?          
                   Try to find out (e.g. by targetted data selection) whether the
                   transaction will run with less main memory.
                   If there is a temporary bottleneck, execute the transaction again.
                   If the error persists, ask your system administrator to check the
                   following profile parameters:
                   o  ztta/roll_area            (1.000.000 - 15.000.000)
                          Classic roll area per user and internal mode
                          usual amount of roll area per user and internal mode
                   o  ztta/roll_extension       (10.000.000 - 500.000.000)
                          Amount of memory per user in extended memory (EM)
                   o  abap/heap_area_total      (100.000.000 - 1.500.000.000)
                          Amount of memory (malloc) for all users of an application
                          server. If several background processes are running on
                          one server, temporary bottlenecks may occur.
                          Of course, the amount of memory (in bytes) must also be
                          available on the machine (main memory or file system swap).
                          Caution:
                          The operating system must be set up so that there is also
                          enough memory for each process. Usually, the maximum address
                          space is too small.
                          Ask your hardware manufacturer or your competence center
                          about this.
                          In this case, consult your hardware vendor
                   abap/heap_area_dia:        (10.000.000 - 1.000.000.000)
                          Restriction of memory allocated to the heap with malloc
                          for each dialog process.
                   Parameters for background processes:
                   abap/heap_area_nondia:        (10.000.000 - 1.000.000.000)
                          Restriction of memory allocated to the heap with malloc
                          for each background process.
                   Other memory-relevant parameters are:
                   em/initial_size_MB:         (35-1200)
                          Extended memory area from which all users of an
                          application server can satisfy their memory requirement.
                   Note which actions and input led to the error.
                   For further help in handling the problem, contact your SAP administrator
                   You can use the ABAP dump analysis transaction ST22 to view and manage
                   termination messages, in particular for long term reference.
         Error analysis          
                   More main memory area was requested.
                   However, all the available space has been used up.
                   Possible reasons:
                   #NAAM?
                   #NAAM?
                   #NAAM?
                   Last error logged in SAP kernel
                   Component............ "EM"
                   Place................ "SAP-Server sapbwp00_PB1_00 on host sapbwp00 (wp 40)"
                   Version.............. 37
                   Error code........... 7
                   Error text........... "Warning: EM-Memory exhausted: Workprocess gets PRIV "
                   Description.......... " "
                   System call.......... " "
                   Module............... "emxx.c"
                   Line................. 1881
                   The error reported by the operating system is:
                   Error number..... " "
                   Error text....... " "
         How to correct the error          
                   Try to decide by analysis whether this request is
                   reasonable or whether there is a program error. You should pay
                   particular attention to the internal table entries listed below.
                   If the error occures in a non-modified SAP program, you may be able to
                   find an interim solution in an SAP Note.
                   If you have access to SAP Notes, carry out a search with the following
                   keywords:
                   SYSTEM_NO_ROLL " "
                   CL_ABAP_CONV_OUT_CE===========CP or "CL_ABAP_CONV_OUT_CE===========CM003"
                   WRITE
                   If you cannot solve the problem yourself and want to send an error
                   notification to SAP, include the following information:
                   1. The description of the current problem (short dump)
                      To save the description, choose "System->List->Save->Local File
                   (Unconverted)".
                   2. Corresponding system log
                      Display the system log by calling transaction SM21.
                      Restrict the time interval to 10 minutes before and five minutes
                   after the short dump. Then choose "System->List->Save->Local File
                   (Unconverted)".
                   3. If the problem occurs in a problem of your own or a modified SAP
                   program: The source code of the program
                      In the editor, choose "Utilities->More
                   Utilities->Upload/Download->Download".
                   4. Details about the conditions under which the error occurred or which
                   actions and input led to the error.
         System environment          
                   SAP-Release 700
                   Application server... "sapbwp00"
                   Network address...... "10.91.1.85"
                   Operating system..... "HP-UX"
                   Release.............. "B.11.23"
                   Hardware type........ "ia64"
                   Character length.... 16 Bits
                   Pointer length....... 64 Bits
                   Work process number.. 40
                   Shortdump setting.... "full"
                   Database server... "csu123"
                   Database type..... "ORACLE"
                   Database name..... "PB1"
                   Database user ID.. "SAPPB1"
                   Char.set.... "C"
                   SAP kernel....... 700
                   created (date)... "Jan 23 2008 23:12:46"
                   create on........ "HP-UX B.11.23 U ia64"
                   Database version. "OCI_102 (10.2.0.1.0) "
                   Patch level. 144
                   Patch text.. " "
                   Database............. "ORACLE 9.2.0.., ORACLE 10.1.0.., ORACLE 10.2.0.."
                   SAP database version. 700
                   Operating system..... "HP-UX B.11"
                   Memory consumption
                   Roll.... 8782704
                   EM...... 5091782384
                   Heap.... 2968385120
                   Page.... 49152
                   MM Used. 6350628336
                   MM Free. 1717574096
         User and Transaction          
                   Client.............. 400
                   User................ "*********"
                   Language key........ "N"
                   Transaction......... " "
                   Transactions ID..... "48AB1576041B51CCE10000000A5B0155"
                   Program............. "CL_ABAP_CONV_OUT_CE===========CP"
                   Screen.............. "SAPMSSY0 1000"
                   Screen line......... 6
         Information on where terminated          
                   Termination occurred in the ABAP program "CL_ABAP_CONV_OUT_CE===========CP" -
                    in "WRITE".
                   The main program was "RSRD_BROADCAST_PROCESSOR ".
                   In the source code you have the termination point in line 5
                   of the (Include) program "CL_ABAP_CONV_OUT_CE===========CM003".
                   The program "CL_ABAP_CONV_OUT_CE===========CP" was started as a background job.
                   Job Name....... "BIBCAST4AVN2YK4QXLZWI2MO0ZD5OD3P"
                   Job Initiator.. "********"
                   Job Number..... 02000600
         Source Code Extract               
         Line               SourceCde
         1               METHOD write.
         2               
         3                 IF view IS INITIAL.
         4               * Single field
         >>>>>                   SYSTEM-CALL CONVERT ID 24
         6                                                      " EXPORTING
         7                     DATA data
         8                     ENDIAN me->endian
         9                     IGNORE_CERR me->ignore_cerr
         10                     N n
         11                                                      " IMPORTING
         12                     LEN len
         13                                                       " CHANGING
         14                     CINFO me->cinfo
         15                     BUFFER me->buffer.
         16                 ELSE.
         17               * Structure
         18                   DATA:
         19                     viewstr TYPE xstring.
         20                   viewstr = view->get_view( ).
         21               
         22                   SYSTEM-CALL CONVERT ID 25
         23                                                      " EXPORTING
         24                     DATA data
         Contents of system fields                         
         Name                         Val.
         SY-SUBRC                         0
         SY-INDEX                         0
         SY-TABIX                         4
         SY-DBCNT                         2
         SY-FDPOS                         1
         SY-LSIND                         0
         SY-PAGNO                         0
         SY-LINNO                         1
         SY-COLNO                         1
         SY-PFKEY                         
         SY-UCOMM                         
         SY-TITLE                         Broadcasting Framework: doorgegeven instellingen uitvoeren
         SY-MSGTY                         S
         SY-MSGID                         RSRB1
         SY-MSGNO                         803
         SY-MSGV1                         
         SY-MSGV2                         
         SY-MSGV3                         
         SY-MSGV4                         
         SY-MODNO                         0
         SY-DATUM                         20080820
         SY-UZEIT                         24659
         SY-XPROG                         SAPCNVE
         SY-XFORM                         CONVERSION_EXIT
         Active Calls/Events                                                                                                                                  
         No.               Ty.                              Program                                                       Include                              Line
                        Name                                                                                                                   
         9               METHOD                              CL_ABAP_CONV_OUT_CE===========CP                                                       CL_ABAP_CONV_OUT_CE===========CM003                              5
                        CL_ABAP_CONV_OUT_CE=>WRITE                                                                                                                   
         8               METHOD                              CL_RSRD_UTILITIES=============CP                                                       CL_RSRD_UTILITIES=============CM006                              8
                        CL_RSRD_UTILITIES=>CONVERT_STRING_TO_XSTRING                                                                                                                   
         7               METHOD                              CL_RSRD_DISTRIBUTOR_MAIL======CP                                                       CL_RSRD_DISTRIBUTOR_MAIL======CM002                              30
                        CL_RSRD_DISTRIBUTOR_MAIL=>SET_BODY                                                                                                                   
         6               METHOD                              CL_RSRD_DISTRIBUTOR_MAIL======CP                                                       CL_RSRD_DISTRIBUTOR_MAIL======CM004                              43
                        CL_RSRD_DISTRIBUTOR_MAIL=>IF_RSRD_F_DISTRIBUTOR_RT~DISTRIBUTE                                                                                                                   
         5               METHOD                              CL_RSRD_SETTING===============CP                                                       CL_RSRD_SETTING===============CM005                              123
                        CL_RSRD_SETTING=>EXECUTE_NODES                                                                                                                   
         4               METHOD                              CL_RSRD_SETTING===============CP                                                       CL_RSRD_SETTING===============CM005                              144
                        CL_RSRD_SETTING=>EXECUTE_NODES                                                                                                                   
         3               METHOD                              CL_RSRD_SETTING===============CP                                                       CL_RSRD_SETTING===============CM005                              144
                        CL_RSRD_SETTING=>EXECUTE_NODES                                                                                                                   
         2               METHOD                              CL_RSRD_SETTING===============CP                                                       CL_RSRD_SETTING===============CM002                              108
                        CL_RSRD_SETTING=>EXECUTE                                                                                                                   
         1               EVENT                              RSRD_BROADCAST_PROCESSOR                                                       RSRD_BROADCAST_PROCESSOR                              180
                        START-OF-SELECTION                                                                                                                   
         Chosen variables                                                                                                                                  
         Name                                                                                                                                  
                   Val.                                                                                                                        
         No.               9                    Ty.                         METHOD
         Name               CL_ABAP_CONV_OUT_CE=>WRITE                                             
         N                                                            
                   -1                                                  
                 FFFF                                                       
                 FFFF                                                       
         DATA                                                            
                   MIME-Version: 1.0##Content-Type: multipart/related;## boundary="=_48AB15C6041B51CCE10000000A5B                                                  
              0                                                       
              0                                                       
              4,44426E+93                                                       
                 D9D5D65239FEA01E0DA3FE45E4D4905A0D5C490124F25C1454BDA02F5E4129D2DF4812153604125133510000000152                                                       
         VIEW                                                            
                 F0000000                                                       
                 F0000000     
         LEN          
                   0
              0     
              0     
         %_SPACE          
              0     
              0     
              2     
              0     
         SYST-REPID          
                   CL_ABAP_CONV_OUT_CE===========CP
              0     
              0     
              4,45445E+39     
                 3CF1210F3FE6FF54F35DDDDDDDDDDD3000000000     
         %_DUMMY$$          
              0     
              0     
              2222     
              0     
         RSJOBINFO          
                                                   00000000000000                                  ##
              0     
              0     
              2,22222E+81     
              0     
         ME->BUFFER          
         ME->ENDIAN          
              0     
              0     
              2     
              0     
         ME->IGNORE_CERR          
              0     
              0     
              2     
              0     
         ME->CINFO          
                   ##41024110#Ā####################ā##¨M퇀##罿N##0000############## ### ###0000#0000#########怀### #
                 0000000000000000000000000000000000000D00700000000000000000000000002000000000000000000000600020     
                 0000000000010000000000000000000010000100F00000000000000000000000000000000000000000000000000000     
                 00333333332000000000000000000001000A4C00740033330000000000000020000000333303333002000002000000     
                 014102411030000001000001010100081008D000FE0000000D000C000D000D00020001000000000003000003010001                                                       
         SY-XFORM                                                            
                   CONVERSION_EXIT                                                  
              0                                                       
              0                                                       
              4,44546E+29                                                       
                 3FE65239FEF5894000000000000000                                                       
         VIEWSTR                                                            
         ME->POSITION                                                            
                   0                                                  
              0                                                       
              0                                                       
         No.               8                    Ty.                         METHOD
         Name               CL_RSRD_UTILITIES=>CONVERT_STRING_TO_XSTRING                                             
         I_STRING          
                   MIME-Version: 1.0##Content-Type: multipart/related;## boundary="=_48AB15C6041B51CCE10000000A5B
              0     
              0     
              4,44426E+93     
                 D9D5D65239FEA01E0DA3FE45E4D4905A0D5C490124F25C1454BDA02F5E4129D2DF4812153604125133510000000152     
         R_XSTRING          
         SY-REPID          
                   CL_RSRD_UTILITIES=============CP
              0     
              0     
              4,45555E+39     
                 3CF2324F549C94953DDDDDDDDDDDDD3000000000     
         %_DUMMY$$          
              0     
              0     
              2222     
              0     
         SYST-REPID          
                   CL_RSRD_UTILITIES=============CP
              0     
              0     
              4,45555E+39     
                 3CF2324F549C94953DDDDDDDDDDDDD3000000000     
         LO_CONVERT_OUT          
              90000006     
                 0000002F     
         %_SPACE          
              0                                                       
              0                                                       
              2                                                       
              0                                                       
         SYST                                                            
                   #######################################H#########ÿ#############################T###ÿ###ฐXu#̀##                                                  
              0                                                       
              0,00E+00                                                       
                 0000000000000000000000000000000000000004000000000F000000000000000000000000000105000F0001570000                                                       
                 0000040800000000000002010100010000000008000000000F000000000000000000000000000604000F000085000C                                                       
         No.               7                    Ty.                         METHOD
         Name               CL_RSRD_DISTRIBUTOR_MAIL=>SET_BODY                                             
         SYST-REPID                                                            
                   CL_RSRD_DISTRIBUTOR_MAIL======CP
              0     
              0     
              4,45555E+39     
                 3CF2324F493429254F2FD19CDDDDDD3000000000     
         ME->O_R_PARAMETER          
              80000007     
                 F0000020     
         ME->IF_RSRD_F_DESIGN_TIME~C_PARAMETER_TYPE_TEXT          
                   DI_BODY
              0     
              0     
              4,45445E+29     
                 49F2F4900000000000000000000000     
         L_BODY          
         %_DUMMY$$          
              0     
              0     
              2222     
              0     
         ME->IF_RSRD_F_DESIGN_TIME~C_PARAMETER_TYPE_PCD_FOLDER          
                   DI_IMPORTANCE
              0     
              0     
              4,45445E+29     
                 49F9D0F241E3500000000000000000     
         L_IMPORTANCE          
                   MEDIUM
              0     
              0     
              444454     
                 D5495D     
         SY-REPID          
                   CL_RSRD_DISTRIBUTOR_MAIL======CP
              0     
              0     
              4,45555E+39     
                 3CF2324F493429254F2FD19CDDDDDD3000000000     
         ME->O_SX_DOCUMENT+148(256)          
                   multipart/related
              0     
              0     
              6,76768E+93     
                 D5C490124F25C145400000000000000000000000000000000000000000000000000000000000000000000000000000     
         ME->O_SX_DOCUMENT+440(8)          
                   Table IT_77861199[0x296]
    DATA=O_SX_DOCUMENT-T_MIMES     
                 Table reference: 2400542&n

    Hi,
    Take help of your basis team to extend the Memory allocation for this Job
    or you need to Restrict the Information that you are Broadcasting
    I mean some more restrictions in the report to reduce the Data Size for brodcasting
    Assigning the Points is the way to say thanks in SDN if helpful
    Regards
    Hari

  • Stale data error for a new page (based on an existing native sshr page)

    Without going into too much detail on why I'm doing this, I copied an existing oracle native page, renamed it, and loaded it into the MDS.
    I navigate to the page by creating an extension on a controller to take me to there on a button click. Also on this page, the native page that I copied is also accessible. There is a similar button click to take you to the native page.
    I had a business requirement to create records for the current year (the native page), and records for next year. Using a dff to differentiate between the two types of records was not an option.
    The copied page is used to simply create records. I extended the native controller to default a value behind the scenes (This is how I differentiaing between the current/next year records). The super.ProcessForm/superProcessFormRequest are there as well in this controller. From there, the page is using the same code as the native page that I copied.
    When I click the "Save As Draft", "Apply", "Cancel" buttons, it works fine.
    However, when I click on the "Apply Add Another" button, I'm getting the following error:
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The record with primary key values {13002} could not be found in view object
    AppraisalsAM.ObjectiveEditAM.ObjectivesVO.
    To proceed, please select the Home link at the top of the application page to return to the main menu.
    Then, access this page again using the application's navigation controls (menu, links, and so on) instead of using the browser's navigation controls like Back and Forward.
    I've researched this error all day today on prior postings/threads, and I haven't found a posting that is similar to the one that I outlined.
    I wouldn't think I would have to do anything programming wise since this is all native code, and the native page works fine. I'm guessing somewhere the native page is getting reference that is causing this error....
    Any help would be appreciated.
    Thanks

    You could use HIDE/UNHIDE funtionality for page 2
    1) create page 2 with all values ...
    2) on page 1 - add jJavascript to show or hide Page 2 dependin on value
    if (fieldvalue eq "condition") them
    Page2.presence = "visible"
    else
    Page2.presence = "hidden"
    endif

  • Stale Data Error in seeded OAF page

    Hi All,
    In my custom oaf page I used master-detail between two tables using PPR (with single selection radio button in master table). From time to time I get "Error: Stale Data ..."
    Absolutely the same error I was able to reproduce in seeded oaf page (R12.1.2):
    1. open OA Framework ToolBox Tutorial -> Sample Browser -> Partial Page Rendering (PPR)
    2. expand Coordinate Master Detail Tables
    3. select first record (Supplier Number 1) and wait when the page will be fully refreshed
    4. VERY FAST select second and immediately third record.
    After that I get:
    Error: Stale Data
    The requested page contains stale data. This error could have been caused through the use of the browser's navigation buttons (the browser Back button, for example).
    Cause:
    The number of displayed records, 3, exceeds the actual number of records, 1, in view object SampleBrowserAM.SupplierSitesVO1. Some of the displayed records may have been deleted
    Additional conditions:
    1. Your connection to server should be "a little slowly" (in my case it's VPN). If apps server is in your local network you can get response very fast and will not get error. In this case repate 1-4 several times.
    2. Browser - IE7 or IE8. In FireFox 3.6 works fine.
    Thanks in advance.
    Regards,
    Sergey

    Hi
    Are you using
    if (!vo.isPreparedForExecution()) if (! vo.isPreparedForExecution ())
    vo.executeQuery(); vo.executeQuery ();
    for VOs in process request of base page!For detailed explanation on this look at this thread: for VOs in process request of base page.
    Please refer this thread may be it help you out..
    Re: Page Refresh and Page Date Rollback
    Ajay

Maybe you are looking for