Passivate Transient Attributes

I have a transient attribute in a View Object that reflects the results of a costly calculation. Passivate to PS_TXN seems to me the best way to keep the result from one request to another.
1. Has the calculated value to be cached by setAttributeInternal in the view row internal buffer, or has it to be cached as a member of the view row impl ?
Passivation calls the getter, so it makes no difference. But how are members of view row objects cleared in the case they are "recycled" ?
2. It seems to me that activating a transient attribute is somewhat buggy: the getter is always called before the restored value appears in the mInner-mCalcs member of a view row, which calculates the value unnecessarily. If the value was not cached with setAttributeInternal, it never appears in mCals.

If your transient attributes are updateable, but you use them only within the scope of a single request (e.g. you set the value within a particular request and use it only until the end of this request but not later), then you do not have to passivate them. However, if they are updateable and you need their values to survive across multiple requests, then you must ensure that these attributes are passivated. In order to configure them to passivate you should do the following:
1. Check the checkbox "Passivate State (e.g. Current Row, Bind Variables, etc.)" in the section "General/Tunning" in VO's definition dialog box;
2. Either check the checkbox "Including All Transient Values" in the same section or leave it unchecked but check the checkbox "Passivate" in the definition of the corresponding VO attributes.
N.B. The setting "Include All Transient Values" affects not only the transient VO attributes but the SQL-derived VO attributes (that are not entity-based) too.
The configuration parameter "jbo.txn.disconnect_level" has nothing to do with passivation/activation. The correct way to test if your VOs behave correctly under passivation/activation is to disable AM pooling (e.g. to uncheck the checkbox "Enable Application Module Pooling" in the corresponding AM Configuration dialog box). When AM Pooling is disabled ADF passivates the corresponding AM state at the end of each HTTP request and activates it at the beginning of next request and so on. In this way you can check if your VOs are passivation/activation-safe.
Please, have a look at the article [url http://docs.oracle.com/cd/E23943_01/web.1111/b31974/bcstatemgmt.htm#sm0318]Application State Management in the documentation for more information and detailed explanation.
Dimitar

Similar Messages

  • Passivate option in VO transient attributes & AM connection type

    Hi
    My English isn't very good.
    I use Jdeveloper 11.1.1.3.0
    I have 2 questions:
    1. I defined some View Obj and in each View Obj I made transient attributes. I don't know if the Passivate option of these transient attributes should be enable or not?
    2. for AM connection type I use JDBC DataSource : "jdbc/ConnectionName". If I change JDBC DataSource to "java:comp/env/jdbc/ConnectionName", does it exist any difference?
    Habib

    If your transient attributes are updateable, but you use them only within the scope of a single request (e.g. you set the value within a particular request and use it only until the end of this request but not later), then you do not have to passivate them. However, if they are updateable and you need their values to survive across multiple requests, then you must ensure that these attributes are passivated. In order to configure them to passivate you should do the following:
    1. Check the checkbox "Passivate State (e.g. Current Row, Bind Variables, etc.)" in the section "General/Tunning" in VO's definition dialog box;
    2. Either check the checkbox "Including All Transient Values" in the same section or leave it unchecked but check the checkbox "Passivate" in the definition of the corresponding VO attributes.
    N.B. The setting "Include All Transient Values" affects not only the transient VO attributes but the SQL-derived VO attributes (that are not entity-based) too.
    The configuration parameter "jbo.txn.disconnect_level" has nothing to do with passivation/activation. The correct way to test if your VOs behave correctly under passivation/activation is to disable AM pooling (e.g. to uncheck the checkbox "Enable Application Module Pooling" in the corresponding AM Configuration dialog box). When AM Pooling is disabled ADF passivates the corresponding AM state at the end of each HTTP request and activates it at the beginning of next request and so on. In this way you can check if your VOs are passivation/activation-safe.
    Please, have a look at the article [url http://docs.oracle.com/cd/E23943_01/web.1111/b31974/bcstatemgmt.htm#sm0318]Application State Management in the documentation for more information and detailed explanation.
    Dimitar

  • Issue with value of  transient attribute after filtering or sorting a table

    Hi guys,
      i'm using jdev 11.1.1.4.0 .
      i've the use case :
             - a table with a column containing a checkbox to mark the selection of  a row
    <af:column align="center" sortProperty="TemIsChosen" filterable="true"
    sortable="true" id="c6">
    <af:selectBooleanCheckbox value="#{row.bindings.TemIsChosen.inputValue}" autoSubmit="true"
    shortDesc="#{bindings.ServersIndicTempVVO.hints.TemIsChosen.tooltip}"
    id="sbc1"
    valueChangeListener="#{backing_initIndicatorsTemp.onSelectTemp}"/>
    </af:column>
             - i select one or more rows with checkboxes
             - if i filter  or sort the table, the selection of the checkboxes reset to not selected (value false by default).
         I understand that for the framework, it's a normal behavior because for filtering or sorting , it re-executes the query from database. And transient attribute is not persistent, so it goes back to the default initial value "false".
         What i would appreciate, it's that filtering or sorting has no effect on the value of the transient attribute, ie end user selection remains.
          I tried to modify query mode of the ViewObject to filter with in-memory data. It works fine but if you reset filter inputs you can't retrieve correct RowSet. Only new RowSet is stored, old is lost.
           So  now it's the filtering feature that doesn't work as expected.
       How can i implement  my use case withouth the troubles i've described.
    Best regards,
    David

    Hi Frank,
       no it's a view object level attribute inside a read-only view object.
      The view object doesn't use any entity.
      Here is the definition of the attribute in the xml file of the VO, if can help you :
    <ViewAttribute
        Name="TemIsChosen"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.Boolean"
        ColumnType="BIT"
        AliasName="VIEW_ATTR"
        SQLType="BIT"
        Passivate="true">
        <Properties>
          <SchemaBasedProperties>
            <TOOLTIP
              ResId="ADD"/>
            <DISPLAYWIDTH
              Value="50"/>
          </SchemaBasedProperties>
        </Properties>
      </ViewAttribute>
    David

  • Is it okay to use VO made up of transient attributes only ??

    Dear Experts,
    I created a VO based on nothing... and later added transient attributes in it.
    It comes very handy to be used as temporary/staging tables instead of using PLSQL tables or DB tables.
    It is very easy and convenient, most importantly, I am happy that it is working fine and I based my whole application on these kind of VOs.
    I am using them for
    1) Store user selected rows in popup and display those on the main page.
    2) To store the data from main page and use those tables on summary popup.
    3) used attributes stored in them for different conditions or decision making in the page.
    I am just worried about
    1) Do I need to passivate all transient attributes?
    2) Do I need to change anything in AM pooling?
    3) What is the memory scope of this? (As of now I have only one jspx page and no taskflows)
    4) What happens when user refresh the page?
    5) What happens when the page times outs?
    6) Since everything is stored in memory when is the system allocates/deallocates memory for such kind of VOs?
    I have almost developed the application and now I am praying that it should not show any unexpected behaviours in the future ...as I have tried unconventional methods and I am not sure about these memory games. Has anyone tried this before? any experiences?
    Thanks
    Rahul

    Hi Nitish,
    Do you mean that I can use programmatic VOs  as my temporarry storage  and it will not have any memory issues?
    That is really great then.. !!!
    Thanks
    Rahul

  • JBO-27008 in transient attributes

    I have in my VO a transient attribute defined with a sub-query.
    I had displayed this attribute as a checkbox in my UIX.
    When trying to commit changes in the page, I have the JBO-27008 message that this attribute is read-only (or course it is). What have I configured wrong to have this message? My VO attribute is set as Updateable = Never, and Passivate is on...

    Idevaldo,
    You could set Updateable to Always, and just don't do anything on the set method of your transient attribute.
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • How to reference a custom property in a vo transient attribute expr + bug

    Hi all
    I have created a transient attribute with an expression that evaluate null content to replace it by a appropriate text.
    <ViewAttribute
        Name="DescriptionUI"
        IsUpdateable="false"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="VIEW_ATTR"
        SQLType="VARCHAR">
        <TransientExpression><![CDATA[((Description == null) ? 'Pas de description' : Description)]]></TransientExpression>
      </ViewAttribute>I have defined a custom property for that attribute that contains the message text. I was surprised to see that the custom property was not associate with the attribute in the source file. Don't understand where the association is done
        <Properties>
          <CustomProperties>
            <Property
              Name="flex.tree.noLabel"
              ResId="flex.noDescription"/>
          </CustomProperties>
        </Properties>I had some difficulties to use the custom property editor. When creating a new related one by using an existing resource the property column value is not changed and the content 'Property' is generated. Because no relationships exists between attribute and the property, the entry is lost in the table referring custom property list for the attribute when your come back into the view object or if you save an another entry in an another attribute.
    So my first question ? Is the attribute editing part the right part to define custom property pairs if they are not related to attributes ? is it a bug ?
    My second question is : is it possible to evaluate the bundle in the expression (replacing the literal 'Pas de description' by an expression) ? What is the expression to use ? Where it is described to do such things in the help or in the documentation ?
    Thank you

    This is wrong
    ((Label == null) ? {FlexParameterModelBundle['flex.tree.noLabel']} : Label)
    What is the correct syntax to refer to the project model standard bundle in the groovy expression ?
    Thank for the help !

  • Error while creating Transient Attribute in VO

    Hi.,
    I am using jdeveloper 11.1.1.5.,
    I had created a GlAcctYearlyBalEO with corresponding VO., I had created an transient attribute GaybCurrBal with type BigDecimal., While i am trying to create another transient attribute GaybCloseBal with type BigDecimal I am getting an error as
    Invalid identifier found in Attribute Name or Type
    GaybCloseBal

    Hello wilhelm,
    If you copy the attribute name from somewhere make sure that your GaybCloseBal has no spaces at the end.

  • Migration issue on default value for transient attribute in 11.1.2

    Experts,
    I migrated my JDev 11.1.1.5 project to JDev 11.1.2. After successful migration i began to run the project and it ran without issue. In the application however when i clicked on any link or button i get the following exception
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=Cannot get property 'saleType' on null object
    Caused by: java.lang.NullPointerException: Cannot get property 'saleType' on null object
         at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)
         at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:154)
         at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:29)
         at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:237)
         at bc4j_com_xxx_portal_model_uiView_SaleVO_SaleTypeTransient_null_gs.run(bc4j_com_xxx_portal_model_uiView_SaleVO_SaleTypeTransient_null_gs.groovy:1)
         at oracle.jbo.ExprEval.internalEvaluateGroovyScript(ExprEval.java:1200)
    In my SaleVO i have a transient attribute whos value is set as
    adf.userSession.userData.saleType == 'ORGANIZATION' ?
                               'LOV_PartyTypeOrg' : 'LOV_PartyType'When i print the value from user session i am getting a value there, so a bit confused about the NPE here.
    Please advice
    Jdev 11.1.2

    Hi,
    this is something you should report to customer support to have them looking at this and helping you out
    Frank

  • How to populate transient attribute from view object dynamically

    I have three 4 tables named as "employee,event,event_progress,and checklist progress". i have created a view object using the first three tables . i ahave also created 5 transient variables in to the same view object.when i dragged the view object in to my page as a table i want to populate those transient attribute.
    i have 5 transient attribute which are present as a column value named as chechlist_name in another table "checklist".those all transient attribute also having two sub rows whose data should be populated from the checklist progress table.

    Hi
    Please post your question on this forum, your question belong to this forum.
    JDeveloper and ADF
    Muhammad Nasir

  • Export Transient Attribute data to excel sheet (from Advance Table)

    Hi,
    I have an advanced table in which its columns mapped with both vo attributes(from database) and transient attributes. If i select 'Export Button' i need to export all data present in the advanced table to excel sheet.. But i am not able to export transient attribute data .. Can anyone help me to solve this problem...
    Thanks,
    Babu

    Babu
    You should be able to export any attribute from the VO, provided they are not hidden fields. Do the values appear on the screen? What is the field type on the advanced table of the attribute you are trying to export?
    --Ritu                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ReadOnly items based on transient attribute - best approach?

    JDev11 question:
    Do you have any idea how can I make items updatable/readOnly based on transient attribute?
    Why is there only feature for "Updatable while new"..?It should be updatable based on function.
    I tried making my coponents disabled based on transient attribute based on a groovy expression.
    However when I invoke af:query, there is a problem - a bug which is similar to this thread:
    http://cn.forums.oracle.com/forums/thread.jspa?threadID=1018561&tstart=89
    So there should be another good approach.. Please suggest anything you think is flexible enough.

    Navid,
    JHeadstart checks whether the attribute definition is queryable before adding it to the list of advanced search attributes. A transient VO attribute can still be set to queryable, for a transient EO attribute this is not possible. We will remove this check on queryability in the upcoming patch release, since you have a valid use case. For now, you can subclass JhsSearchBean and override method createArgumentListForAdvancedSearch and comment out the check for "def.isQueryable()".
    Steven Davelaar,
    JHeadstart Team.

  • Difference between EO and VO Transient Attributes

    Guys,
    We do have Transient attributes at EO and VO Level. Are there any difference in that?
    Can you give me use cases where we need to prefer EO Transient attribute instead of VO Tranisent attribute or Vice versa...
    Any help appreciated....

    EO transient Attribute - behave like a column in the db table.. either it can be mapped tothe db column or not..
    VO transient attribte - behaves like a query attribute.. its just used to mape the attribute with the underlying EO attributes.. or for any calculations to be made based on other attributes..

  • Can Shuttles be based non-base  table ViewObjects with transient attributes

    Hello,
    Users have to select records from a data collection and a Shuttle looks most appropriate/nice for this purpose. We can introduce technical intersection tables in order to generate the Shuttles with JHeadstart 10g R3 if necessary, but there is no “functional” need to update any data in the database and therefore it would be practical if the ‘right’ side from a Shuttle can be based non-base table ViewObjects with transient attributes only. So, our interested is to know which records have been selected, i.e. moved to the right side from the Shuttle.
    Hope that my question is clear enough.
    Greetings,
    Michael

    Michael,
    This cannot be generated out-of-the-box.
    It is easiest to add the shuttle post-generation to your page, and then create a custom template to generate your custom shuttle into the page. I suggest you take a look at an example of a generated shuttle in a page, and the JHeadstart IntersectionShuttleBean class. You will see that the value property of <af:selectManyShuttle> points to the selectedKeys method in the JHeadstart Shuttle bean. In your case, you can create your own managed bean and bind the value property to your own method which will provide you access to the selected rows. The value property of the selectItem within the af:selectManyShuttle determines the property that is used to identify the selected row (which is the row key in case of Jhs-generated shuttles).
    Steven Davelaar,
    JHeadstart Team.

  • What is the default value of boolean type transient attribute in VO?

    Hi All,.
    jdev version-11.1.2.1.0
    i have created one vo based on eo where i add one boolean type transient attribute Marked(uihint checkbox).
    now i have apply view criteria on this vo.
    like---
         ViewObject vo=getView(iterator);
         vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
         ViewCriteria vc=vo.createViewCriteria();
         ViewCriteriaRow vcr=vc.createViewCriteriaRow();
         vcr.setAttribute("Marked", "true");//Setting attribute on view criteria.
           vcr.setConjunction(ViewCriteriaRow.VCROW_CONJ_AND);
           vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE);
         vo.applyViewCriteria(vc);//Apply view criteria on vo.
         vo.executeQuery();
         vc.add(vcr);
       vo.executeQuery();this code running fine and that is selected only those row which i have cheked.
    but now i want to apply view criteria that select select those rows that are not checked.
    like-
    vcr.setAttribute("Marked", "false");but it is not return any row.
    if select checked any row and then uncheked that row so marked attribute for this row set false. but rows that are unchecked by default not return.
    so my question is that what is default value of Marked attribute when user not take any action i will try
    vcr.setAttribute("Marked","null");
    but not working.

    i have tried this but this is not working.
    follwing code working for Null case not for False
    vcr.setAttribute("Marked","is null"); this code display all rows who has null but when i checked any row and then unchecked so that row get value "false" also not display.

  • Problem with transient attribute attach to standard vo from the controller

    Hi all,
    I attached two transient attributes to the standard vo through controller.
    Then i passed values to these fields from controller based on another field in the standard vo.
    I created two columns in the table without given the view instance and view attribute.
    But in the controller i'm setting the view instance and view attribute for this two columns.
    After i applied this extended controller it is working fine, but one problem is there.
    Once if i clear the cache and then i enters the page, the extended fields are appearing with null. if i press F5 in the browser then its working fine.
    same problem happens only when the cache cleared or server gets bounced. so i need to go each page and press F5 once then everything is fine.
    Here, I shared my code, please tell me what is the problem and how to solve this.
    Code:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject cvo=(OAViewObject)am.findViewObject("FinalCompListVO");
    if(!cvo.isPreparedForExecution()){
    cvo.executeQuery();
    if(cvo!=null){
    try{
    String temp1=cvo.findAttributeDef("XXCompNameAttr").toString();
    }catch(Exception e){
    cvo.addDynamicAttribute("XXCompNameAttr");
    try{
    String temp1=cvo.findAttributeDef("XXCompTypeAttr").toString();
    }catch(Exception e){
    cvo.addDynamicAttribute("XXCompTypeAttr");
    Row compRow[]=cvo.getAllRowsInRange();
    for(int i=0; i<compRow.length;i++){
    FinalCompListVORowImpl cVORowImpl=(FinalCompListVORowImpl)compRow;
    String name[]=cVORowImpl.getName().split("\\.");
    String compName=name[2];
    cVORowImpl.setAttribute("XXCompNameAttr",compName);
    for(int i=0; i<compRow.length;i++){
    FinalCompListVORowImpl cVORowImpl=(FinalCompListVORowImpl)compRow[i];
    String name[]=cVORowImpl.getName().split("\\.");
    String compName=name[0];
    if(i==0){
    cVORowImpl.setAttribute("XXCompTypeAttr","Behavioral");
    }else if(i!=0&&compName.equals("FUNC")){
    cVORowImpl.setAttribute("XXCompTypeAttr","Functional");
    break;
    OAMessageStyledTextBean mstb=(OAMessageStyledTextBean)webBean.findChildRecursive("XXCompTypeCol");
    mstb.setViewUsageName("FinalCompListVO");
    mstb.setViewAttributeName("XXCompTypeAttr");
    OAMessageStyledTextBean mstb1=(OAMessageStyledTextBean)webBean.findChildRecursive("XXCompNameCol");
    mstb1.setViewUsageName("FinalCompListVO");
    mstb1.setViewAttributeName("XXCompNameAttr");
    Thanks in advance,
    SAN

    Hi,
    1. ExecuteQuery should already be executed in Base Controller, So please check if you need it. though i don't think that might be causing the issue.
    cvo.executeQuery();
    2. The code where you call findAttributeDef and handle the Exception, Can you debug that portion. As It may not be throwing exception in any case and so the Attributes were never added to VO and Page Displays null..
    I am not sure, but i think the issue seems to be around 2.
    all the best
    -Idris

Maybe you are looking for

  • Bug (?) with Corporate Connectivity is (not) Working check

    Noticed something odd.  In situations where: Direct Access client is offsite their Internet access is via WiFi they first have to enter their access credentials through a web-based captive portal before access is granted then the Corporate Connectivi

  • Multiple where conditions in one parameter

    Hi, Is it possible to have more than one where condition in one parameter? For example, my WHERE_CLAUSE parameter holds the value "where id='12345' and name='john smith'" when i run the report, I get a [052008_033528064][][EXCEPTION] java.lang.NullPo

  • Can't execute java from prompt command on xp. . .

    hello! that's the following: I'm trying to execute "java Teste.class " from prompt command and it throws: Exceptio in thread "main" java.lang.NoClassDefFoundError in thread main. The Teste.java file is compiled finely using "javac Teste.java" My envi

  • Usage Solution Manager Solution Directory

    Hi, Does anyone knows what is the purpose or usage of Solution Manager Solution Directory? Please and thanks Kumar

  • Cannot delete saved passwords in Safari on Yosemite

    I am unable to remove any passwords from Safari (from the Passwords tab in Preferences). This is on Yosemite. I have tried the solution outlined here: Yosemite Safari won't let me delete/change passwords, but it appears to make no difference. Does an