Use of transient

by learning i came to know that use of transient variable may increase the performance for a web application,
But i am not very clear where exactly i have to use transient.
suppose this is my class,
public class ConServ extends HttpServlet {
     transient private  Vector allNodeVC;
     transient private  Vector allNodeVC1;
     //database acess class
                transient private Connection conn;
     transient private DB2Pool db2Pool;
     //xml class
                transient private  XmlClass map;
     transient private  XmlClass ws;
}the HttpServlet class implements java.io.Serializable,
now if i use "transient " for the upper vaiables will it effect in execution time?
and what will be the diffrent using and without using transient in this case?

debdutta wrote:
jbish wrote:
if you need that object as part of the state of the object you are serializing then transient would not be a very good choice. can you please explain this a more? i don't have much idea about object serialization,
and in my upper example, so i can use transient keyword,
those variables are not used to read or write in fileSerialization is used to store objects or "send" them from one place to another using streams.
Transient variables, and hence the object they reference if not primitives, do not become part of that stream.
public class Point {
    private int x;
    private int y;
}Now, in the above example, x and y are part of a Point object's state (a rather important part :). If x and y are made transient then those variables would not become part of the stream. The Point object would not be of much use without those two variables.

Similar Messages

  • How to Create an Input Form using a Transient View Object?

    I would like to use a Transient View Object to store data from input forms across a multiple-page enrollment process.
    My question is how to I create the input form using the Transient View Object on the .jspx page? Do I drag/drop an ADF creation form onto the page? Or, use a regular ADF form? Do I need to create the initial row progammatically?
    Just looking for some general directions or set of instructions? I've looked at the SRDemo example (Globals Transient View Object), but I'm not sure how they created the page at design time?
    thanks

    Well following the SRDemo example, this seems to work:
    1. Create Transient View Object
    2. Add to Application Module as a Data control
    3. Add to .jspx page as an ADF Form (not as an ADF Create Form)
    4. Add following code to Application Module containting Transient VO instance:
    protected void prepareSession(Session session) {
    super.prepareSession(session);
    insertTransientViewObjRows();
    private void insertTransientViewObjRows() {
    ViewObject transientvo = getViewObj1();
    transientvo.clearCache();
    transientvo.insertRow(transientvo.createRow());
    }

  • Use of transient fields in Collections Framework?

    Hi all,
    I've been playing around with the reflection API for introspecting various members of the Collection Framework (CF).
    It turns out that many of the fields used by the members of the CF use the transient fields for their data-storage. For example: ArrayLists stored their elements in a transient field named elementData.
    Following the Java Language Specification, the transient fields are therefore not part of the object's persistent state. As a consequence, it is "not" possible to make such an object persistent (although, from what I understood, you could serialize such an object including its element data).
    Is there any particular reason why those fields are defined as transient?

    Hi all,
    I've been playing around with the reflection API for
    introspecting various members of the Collection
    Framework (CF).
    It turns out that many of the fields used by the
    members of the CF use the transient fields for
    their data-storage. For example: ArrayLists stored
    their elements in a transient field named
    elementData.
    Following the Java Language Specification, the
    transient fields are therefore not part of the
    object's persistent state. As a consequence, it is
    "not" possible to make such an object persistent
    (although, from what I understood, you could serialize
    such an object including its element data).
    Is there any particular reason why those fields are
    defined as transient?You need to distinguish between the data logically contained by a Collections object (or indeed any other), and how that data is represented both in memory, and in the persisted form. A class marks a field transient simply to inform the default serialization mechanism that the field does not form part of the persistent representation. Typically this is either because it is only used for cacheing purposes, or because the class itself takes responsibility for the persisted form.
    The Collections classes often have a complexity in their memory representation that is related to their performance requirements, but which serves no purpose in their persisted form. Consider a TreeMap, for example. Its memory representation involves a tree, but the only things that need to be persisted are the key/value pairs. Persisting the tree would be wasteful in both time and peristent storage.
    Sylvia.

  • Upgrade 10.2.0.4 RAC to 11.2.0.2 RAC using a transient logical standby?

    Has anyone performed a successful upgrade from 10.2.0.4 RAC to 11.2.0.2 RAC using a transient logical standby? I found one reference to this white paper "http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-transrollupg-168590.pdf" that describes steps to us transient logical standby to upgrade to 11.1.0.6 but I wasn't sure if it also works for upgrades to 11.2.0.2.
    I have a 3 node 10.2.0.4 RAC cluster running on rhel 4.8 with a 3 node dataguard physical standby (which the customer want to keep as a physical standby after the upgrade) that I need to upgrade to 11.2.0.2 with as little downtime as possible. This approach seems like a possible solution but I want to know if it is proven.

    Hi,
    I have a 3 node 10.2.0.4 RAC cluster running on rhel 4.8 with a 3 node dataguard physical standby (which the customer want to keep as a physical standby after the upgrade) that I need to upgrade to 11.2.0.2 with as little downtime as possible. This approach seems like a possible solution but I want to know if it is proven.I suggest you to log a S.R and confirm the same.
    thanks,
    X A H E E R

  • Use of transient objects via SIO. Is it possible?

    Hi !
    There are two applets. The first one contains a transient array of bytes (let denote it A)and a method, which can be called via Shareable Interface. This method uses array A. And when I call this method via SIO from the second applet, an error with SW = 6F 00 occurs.
    Is it possible to use transient arrays via SIO? and what does happen whith them?
    Java Card Specification says that "only the contents of the fields of the object (except for the length field) have a transient nature". So, they have to exist... but something goes wrong.

    It really runs with APDU buffer of usual Java Cards! Of course it works with the APDU buffer: it's a global array.
    But SIM cards haven't such global array. Does it mean
    that this scenario will not run there?Yes, it won't. As the APDU buffer is a global array (what implies that it is also a temporary JCRE entry point object), you're not able to store the reference in a class attribute or instance variable. So it's not useable for a Toolkit Applet which has been triggerd by an event.
    A work around would be to pass each single primitive data unit to the Shareable Interface Object. But don't ask for performance ;o)

  • Upload a table data(using a transient VO) from excel using ADF DI

    Hi
    I have a scenario where I need to get data from excel into a custom method in model layer.
    Requirement:
    Transient VO(associated to AM, shown in datacontrols) included in the jspx as a table
    I used the same table/tree binding to use it as a table in the excel sheet. I have a custom method in AM(that is exposed) that is invoked on click of a button.
    Problem is that the data is not coming up to that method.
    Here is the code I used in the custom method
    RowSet rowSetVO = (RowSet)findViewObject("ReadOnlyVO");
    Row[] allRowsInRange = rowSetVO.getAllRowsInRange();
    for(int i=0; i<allRowsInRange.length;i++) {
    ReadOnlyVO1RowImpl indRow = (ReadOnlyVO1RowImpl)allRowsInRange;
    System.out.println("Name :: "+indRow.getName());
    The same code is running fine and the data getting uploaded/shown in the method when the corresponding jspx is used. But when excel is used, nothing is coming up.
    Thanks in advance
    Regards
    Ravi

    Let's assume that your VO has some existing rows and that the user clicked a button that included Table.Download.
    Now, the user modifies various rows in the ADF(di) Table component in Excel.
    The next step is for the user to click a ribbon command that includes Table.Upload.
    This ADFdi action will upload the altered rows to the VO and invoke the configured commit action.
    Please review this doc for more info:
    http://docs.oracle.com/cd/E24382_01/web.1112/e16180/work_table_comp.htm#BABIAAGH

  • What is the use of transient keyword

    never read any java tutorial with the transient keyword explained

    the transient keyword means that the value of that variable will not be written to a file, or send across a stream (something like that). It has something to do with security issues. I've never used it myself, this is just what I remember reading somewhere.

  • Practical use of a transient VO

    hi i am new to ADF and i am slightly confused about the use of the transient view object. i am clear on an updatable VO which is used to update and read only VO whose practical use would be for LOVs and also showing read only data on the UI, . Can some one help me understand the practical use of transient VO and also the VO based on a query. Thanks in advance. I know this is a basic question but i am not getting the practical usage of it.

    Hi,
    If you can give some practical approaches where the transient VOs are required that would help me understand the actual concept of transient VO.
    well answer is here. https://blogs.oracle.com/vijaymohan/entry/transient_vo_powerful_j2ee_design_pattern
    go through the second point.
    I am pretty aware that the  transient VO doesn't refer to a table/EO/DB and the attributes are created while creating the VO.
    yeah you 're right.
    The same VO can be dragged as a form suppose.. but what after that ... what help does it do to a developer in achieving a logic ?
    Consider this simple scenario currently fusion web app team don't have a db.so no db fetches for their application. just they use transient vo for grab the details from the end user and manipulate some sort of data show to end user these values live until session lives.
    At one point they will send the data via web services.
    concern service communicate with some other team and perform insertion and update ion and deletion of data in db.
    so here no need to do use entity derived vo. I can't explain much here about whole thing.
    Thanks.

  • How can i remove services from the transient name service?

    hello all..
    i am using the transient name service and i would like to remove a service if a server goes down...how can i do that?

    hmm the thing is were to put the statement... after the code that makes the server waits for invocations?
             synchronized(sync){
                sync.wait();
             ncRef.unbind(pathEnglishToGreek);
           what happens if the server failed/hw failure/ shutdown the machiene/ ctrl+c or sth else?

  • How to Deploy all mappings in a module using OMB+

    Hi,
    I am using OMB+ to deploy project from DEV to QA , i used a OMB+ script to do the export and one import script to do the import/deployment
    both Export and Import are working fine , the problem is in the Deploy part of Import script,
    in this script I am connecting to the Repository and importing the Project from DEV and then changed the Context to the module and then connected to the Control centre , when i tried to deploy the mapping i get the error saying the location is not registered to the module
    ususally if i use the GUI i double click the module and add the location to the module, howcan i do that in OMB+ ,
    Example script would help me a lot
    and for deploying the mappings i am using
    OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'DEPLOY_PLAN' ADD ACTION 'MAP_DEPLOY' SET PROPERTIES (OPERATION) VALUES ('CREATE') SET REFERENCE MAPPING 'MAPPING NAME'
    but i don't want to pass mapping names like this i just want to deploy all mappings in a single step
    Please advice me
    Thanks in Advance
    Suresh
    Edited by: Suresh_G on Sep 9, 2008 3:30 PM

    Hi Mahesh,
    here is my script,
    # Connect to the repository
    OMBCONNECT datarepdb/[email protected]:1535:ukfndr USE REPOSITORY 'owb_rep'
    puts stdout {Connected to Repository }
    #Importing the OWB Project
    OMBIMPORT MDL_FILE 'C:/Temp/local/ORAFINDATAREPOSITORY.MDL' \
    USE MERGE_MODE \
    OUTPUT LOG 'C:/Temp/local//ORAFINDATAREPOSITORY_IMP.LOG'
    puts stdout {Import Finished }
    OMBCC '/ORAFINDATAREPOSITORY'
    # Assign the location to the oracle module
    OMBALTER ORACLE_MODULE 'DATAREPDB' SET REFERENCE LOCATION 'DATAREPDB_LOCATION'
    OMBALTER ORACLE_MODULE 'DATAREPDB' SET PROPERTIES (DB_LOCATION) VALUES ('DATAREPDB_LOCATION')
    puts stdout {location to the oracle module registered}
    # Connect to Control Centre for Deployment
    OMBCONNECT CONTROL_CENTER USE 'dugout'
    puts stdout {Connected to Controle Centre}
    OMBCC '/ORAFINDATAREPOSITORY/DATAREPDB'
    #Starting the Deployment
    puts stdout {Starting the Deployment}
    OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'DEPLOY_PLAN' ADD ACTION 'MAP_DEPLOY' SET PROPERTIES (OPERATION) VALUES ('CREATE') SET REFERENCE MAPPING 'XXDR_GL_BALANCE'
    OMBDEPLOY DEPLOYMENT_ACTION_PLAN 'DEPLOY_PLAN'
    OMBCOMMIT
    puts stdout {Deployed Mappings and Disconnecting }
    OMBDISCONNECT
    I embeded your script in mine but i was getting errors , i am still trying to resolve it, mine is a TCL script can u please suggest me where actually i should incorporate the ur code and to what level,
    in my case we have just one module and need to deploy all the mappings in that module , the above script working fine but i don't want to give all names of mappings hardcoded.
    Thanks in advance

  • Can we show blank lines for transient VO?

    I'm a newbie.. Using JDev 11.1.1.2.0.
    I have a requirement like this (simplified): On first page show an editable table with 2 columns: part no and date, and 10 blank rows. On hitting submit, it should go to a second page which has the part number, date, and price (from database API).
    I went thru storefrontdemo example and I see they have used a transient VO for the cart. So I created a transient VO with 3 attributes - part number, date and price. Also created an AM method in the Impl class to get the price for a part/date combination.
    Few questions:
    1. How can I show the first page with blank rows? When i drag and drop the VO from data control palette as an editable table, I get no rows.
    2. Is it wise to invoke the AM method for each row and populate the price on the transient VO attribute? Will the transient VO values display on the second page, assuming both the first and second pages are in a task flow?
    Thanks in advance!
    Kalp
    Edited by: user514831 on Jan 17, 2011 1:56 PM

    Answering my own question - I just added a CreateInsert operation from data control palette and rewired the "Method" to a custom bean that does something like:
    Row row = vo.createRow();
    vo.insertRow(row);

  • Question on View Object method to use to reset a data entry form?

    I am using a transient View Object form for the purpose of collecting and persisting data entered by users in a set of web data forms that span multiple pages. In the Application Module, I create the first row (see below.) After the user submits the last form, I programmatically add the data to the database (later may change to an Entity Object, but right now I don't use one.) So, the data they entered remains in the VO (it only ever has one row.)
    My question is which method do I use to clear out the current set of data values. I tried VO.clearcache() but it deletes the row, and VO.reset() did not clear the data? If the only way is to delete the row, then please advise the best way to re-create the row or re-set the iterator.
    thanks!
    -- sample code to insert initial row in App Module --
    protected void prepareSession(oracle.jbo.Session session) {
    super.prepareSession(session);
    insertTransientViewObjRows();
    private void insertTransientViewObjRows() {
    ViewObject transientvo = getView1();
    transientvo.clearCache();
    transientvo.insertRow(transientvo.createRow());
    ---- in service method after user submits the form and row remains in VO, I have tried: --
    vo1.reset(); // does not delete data from the row
    vo1.clearCache(); // deletes the row

    Thanks. Yes this looks more like what I need. How do I call this method from the client-tier, or from within a service method in my Application Module?
    vo1 = findViewObject("myViewObject");
    row = (MyViewRowImpl)vo1.first();
    row.initDefaults();
    compiler error message received:
    Error(279,21): method initDefaults() has protected access in class oracle.jbo.server.ViewRowImpl
    "Customer applications should not access this class on the client-tier of an application. Instead, the Row interface should be used for client tier access"
    Which Row interface method can I call?
    Message was edited by:
    javaX

  • Using Entity Framework with SQL Azure - Reliability

    (This is a cross post from http://stackoverflow.com/questions/5860510/using-entity-framework-with-sql-azure-reliability since I have yet to receive any replies there)
    I'm writing an application for Windows Azure. I'm using Entity Framework to access SQL Azure. Due to throttling and other mechanisms in SQL Azure, I need to make sure that my code performs retries if an SQL statement has failed. I'm trying to come up with
    a solid method to do this.
    (In the code below, ObjectSet returns my EFContext.CreateObjectSet())
    Let's say I have a function like this:
      public Product GetProductFromDB(int productID)
         return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
    Now, this function performs no retries and will fail sooner or later in SQL Azure. A naive workaround would be to do something like this:
      public Product GetProductFromDB(int productID)
         for (int i = 0; i < 3; i++)
            try
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
            catch
    Of course, this has several drawbacks. I will retry regardless of SQL failure (retry is waste of time if it's a primary key violation for instance), I will retry immediately without any pause and so on.
    My next step was to start using the Transient Fault Handling library from Microsoft. It contains RetryPolicy which allows me to separate the retry logic from the actual querying code:
      public Product GetProductFromDB(int productID)
         var retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(5);
         var result = _retryPolicy.ExecuteAction(() =>
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault;
         return result;
    The latest solution above is described as ahttp://blogs.msdn.com/b/appfabriccat/archive/2010/10/28/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications.aspx Best Practices for Handling Transient Conditions in SQL Azure Client
    Application (Advanced Usage Patterns section).
    While this is a step forward, I still have to remember to use the RetryPolicy class whenever I want to access the database via Entity Framework. In a team of several persons, this is a thing which is easy to miss. Also, the code above is a bit messy in my
    opinion.
    What I would like is a way to enforce that retries are always used, all the time. The Transient Fault Handling library contains a class called ReliableSQLConnection but I can't find a way to use this with Entity Framework.
    Any good suggestions to this issue?

    Maybe some usefull posts
    http://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx
    http://geekswithblogs.net/iupdateable/archive/2009/11/23/sql-azure-and-entity-framework-sessions-from-pdc-2009.aspx

  • Transient Entity Attribute as an Assoc

    Can I use a transient Entity attribute as an Assoc?
    I created an Attribute at the Entity level that is not mapped to a table. The entity is called FirstEndEntity.
    Then I created an Association between FirstEndEntity and OtherEndEntity. I used the attribute that i just created at FirstEndEntity, (so its transient) and the OtherEndEntity attribute is mapped to DB table.
    When I tested the assoc, the wizard complains, saying he cannot resolve the attribute that i just created?
    Is there a way around this?

    yes, you're right, I've tested it in 12.1.3 and error message was displayed.
    it seems it's a bug(bad bug ) in both 11.1.1.7 and 12.1.2. and now what can I do? is there any way to display the the error message?
    Regards
    Habib

  • ADF 11.1.1.6 - Transient Values lost on Requery

    I have a requirement where we store a checkbox value for a row using a transient value on the view.
    The transient attribute is a simple boolean and is bound to the UI by a selectBooleanCheckbox.
    I have set the "Refresh Expression Value" on my transient attribute to false and the default value to true.
    My question is: when we refresh the page (F5), is there a way to stop the transient value for all the rows going back to true.
    The net effect is:
    user logs in (all rows ticked)
    user selects/deselects some rows
    clicks F5
    all the rows are back to ticked

    F5 does a full page refresh executing the query again after clearing the cache, so it loses the check marks. If your VO is based on an EO you can add a transient attribute and store the checkmark there.
    Timo

Maybe you are looking for