What is persistent variable?

Hi!
what is the correct definition for persistent variable in java?
Thanx
-Sasi

what is the correct definition for persistent variable
in java?In what context did you see this?
The term "persistent" is used to refer to data which maintains state between runs of the applications. The data is stored in some fashion (database or file.)
As an example the following two terms are equivalent (although the first is more general.)
The customer will be persisted.
The customer will be stored in the database.
Normally a single variable is not stored. Although that might be the case for user preferences in a GUI for example.

Similar Messages

  • Session Persistent Variables

    I am working on converting a legacy client/server application to JSP/ADF/Struts in JDeveloper 10g. (and learning Jdev and Java at the same time.) The client/server version maintained a list of variables that persisted during the users's session, and then at application close were posted to a user settings table in the database.
    I'm "assuming" that a similar approach is both possible and best in this new environment, but I haven't come across any examples of how to implement it.
    Does anyone know of any example projects or documentation that describe how to persist variables throughout a user's session?

    What I'd like to maintain are application-specific values, such as the primary key of the selected record, user preferences, etc. (Nothing that Oracle stores in views, unfortunately.) What I'm envisioning is some sort of java class that holds the values, and is maintained by the business tier for the duration of the user's session. Values will change during the session, but once the session is terminated, the values must be flushed to the database and then restored when the user logs in next. What I don't know how to do is how to implement this in the business tier. Is it possible to maintain variables like this and associate them with a specific user? Are there any example apps out there that do that? Alternatively, is there a better way to do this that I haven't thought of?

  • What is session variables in BSP

    Hi
    I am using using IC Webclient. can anyone help me to findout the details about session varibales ?
    Best Regards
    Bhavishya

    hi,
    Session variables is a handy way to define a persistent variable.The standard variables used in ColdFusion can be only transferred or sent to the next page before it is necessary to restate the variable. In some situations, you may want to define a variable that will apply to all the pages during a single session of the user. An example is when the pages a user sees are personalized to his or her specific needs. In such a case, session variables are defined and used.
    Session variable persistent
    A session variable is one of several types of variables that persist across multiple templates:
    >Server variables - Accessible by all clients and applications on a single
    >Application variables - Tied to a single application and accessible by multiple clients
    >Client variables - Tied to a single client over multiple sessions
    >Session variables - Exist for one client or browser during a single session
    >Cookie variables
    Session variables are designed to hold information that you seldom write but are read often.
    Defining session variables
    Session variables are normally defined in the Application template, but can be also defined on all applicable pages.
    Application template
    The standard method of using session variables is to define them in the application.cfm template, which is a special ColdFusion page that is processed before the other pages in a session. It usually should be in the session root directory.
    CFAPPLICATION tag
    To enable the use of session variables, as well as client and application management, you should use the CFAPPLICATION tag in the Application template. A typical tag would be:
    <CFAPPLICATION NAME="Name"
    SESSIONMANAGEMENT="Yes"
    SESSIONTIMEOUT="#CreateTimeSpan(0, 0, 20, 0)#">
    where:
    >NAME is required to avoid problems if you have session variables tied to separate applications.
    >SESSIONMANAGEMENT is required to enable the session variables.
    >SESSIONTIMEOUT is optional and limits the time the variables will stay in memory (20 minutes in the example) Note that the default is 20 minutes, so you really may not need this unless you want to change that number.
    Setting variables
    After the CFAPPLICATION tag, you can set your session variables, using the CFSET tag. You must always refer to session variables with the prefix session. Thus, you could define a session variable, such as:
    <CFSET session.name="#form.othername#">
    Should lock variables
    You should lock the session variables to avoid problems when several people are using the system at the same time. An example of this is:
    <CFLOCK TIMEOUT="30" NAME="#session.sessionID#" TYPE="Exclusive">
    <CFSET session.name="#form.othername#">
    </CFLOCK>
    Defined on applicable pages
    A problem in using the Application.cfm template is that it is often difficult to change your session variables, once they have been set. An alternative is to use the CFAPPLICATION tag in each applicable page:
    <CFAPPLICATION NAME="Name"
    SESSIONMANAGEMENT="Yes">
    You then can define the session variable in the first page, accessed:
    <CFOUTPUT QUERY="return">
    <CFSET session.ID="#ID#">
    </CFOUTPUT>
    This is a compromise between the standard method and defining the variable on each page.
    Example of use
    Suppose a user logged in to the site. His name could be sent through a form and entered in Application.cfm. Then the session will constantly refer to him by name.
    Application.cfm
    <CFAPPLICATION NAME="Name"
    SESSIONMANAGEMENT="Yes">
    <CFSET session.name="#form.othername#">
    Start.cfm
    <CFOUTPUT>
    <H1>Hello #session.name#</H1>
    </CFOUTPUT>

  • I need in Formula Node to assign to the variable value 4000000000!!! What kind of variable it should be???

    i've just tryed to write unsigned in32, but it does not understand 'unsogned'... But i need variable to be unsigned, because the max value = 4000000000... So, how can i solve this probleme???

    Hi,
    I don't see exactly what you're trying to do here.
    Where do you want to assign the variable 4000000000 to? If you want it as an
    input, just use a dbl, with only zeros behind the coma.
    Note that an integer is a number without any decimals. An integer in LabVIEW
    is this, but with an extra limitation that it can only be 32 bits... So a
    dbl can be an integer.
    If the input dbl is not an integer, use round, round to -inf or round to
    +inf to make it one. This can also be done if the output needs to be an
    integer.Inside the formula node floor(x), int(x), intrz(x) or ceil(x) can be
    used to make integers.
    I hope this is what you mean... I can't see any problems doing this.
    Regards,
    Wiebe.
    "DrON" wrote in message
    news:506500000008000000E
    [email protected]..
    > I need in Formula Node to assign to the variable value 4000000000!!!
    > What kind of variable it should be???
    >
    > i've just tryed to write unsigned in32, but it does not understand
    > 'unsogned'... But i need variable to be unsigned, because the max
    > value = 4000000000... So, how can i solve this probleme???

  • What are mapping variables & parameters ?

    1.In real time scenario where can we use mapping parameters and variables?
    2.what are mapping variables & parameters ?

    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_xplan.htm#CACICEDJ]
    BPS@xe>explain plan for
      2  select sysdate from dual;
    Explained.
    BPS@xe>select * from table(dbms_xplan.display());
    Plan hash value: 1388734953
    | Id  | Operation        | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |      |     1 |     2   (0)| 00:00:01 |
    |   1 |  FAST DUAL       |      |     1 |     2   (0)| 00:00:01 |
    8 rows selected.
    BPS@xe>select * from table(dbms_xplan.display('PLAN_TABLE',null,'BASIC'));
    Plan hash value: 1388734953
    | Id  | Operation        | Name |
    |   0 | SELECT STATEMENT |      |
    |   1 |  FAST DUAL       |      |
    8 rows selected.

  • What is system variable to find the current list line in list processing

    hi
    what is system variable to find the current list line in list processing

    Hi,
    Please find below the system variable related to list processing
    LILLI    INT4     10     Processing lists       List line selected
    LINCT  INT4     10     Creating lists           Page length in a list
    LINNO INT4     10     Creating lists            Current line
    LINSZ  INT4     10     Creating lists          Line width in a list
    LISEL  CHAR     255     Processing lists       Contents of the chosen line
    LISTI    INT4     10     Processing lists       Index of the chosen list
    Thanks,
    Muthu.

  • What is static variable.

    What is static variable. what is difference between  static variable and public variable?

    Static variables belong to the Class. Non-static variables belong to Class instances.
    Public variables can be accessed from outside of the Package. Non-public variables can only be accessed within the Package.
    So they are quite different thing. You can have Static variables, Public Static variables, and Private Static variables...

  • What's the variable gpuAccelerate in stage object for?

    Hi!
    What's the variable gpuAccelerate in stage object for?
    It's per default false.
    I've tried to find an answer to this but I couldn't get one from tech docs.
    It also doesn't seem to change paints (looking at one of my animations in Canary's Inspector) if true.
    Thanks,
    Volker

    Hi Darrel, hi Elaine!
    @Darrel: I'm aware of the hardware (GPU) acceleration options in different browsers/systems. I'm just wondering _what_ the boolean in the script output of Edge actually does.
    @Elaine: But _when_ would it switch on GPU in the animations and _where_ (which browsers/platforms)? There's no documentation I've found so far about it and the var is included in every animation with default 'false'.
    And what are the possible pitfalls?
    After beautifying edge-1.5.0.min.js it seems that it just enables the translateZ trick for (some) Webkit based browsers.
    if (this.gpuAccelerate && f[0].style && (typeof n === "undefined" || n === "" || n === "none")) f[0].style.webkitTransform = "translateZ(0)";
    But Edge does anyways already use 3D transitions in its animations?
    Thanks,
    Volker
    Message was edited by: Volker_E

  • What's JAVA_HOME variable?

    Hey:
    what's JAVA_HOME variable? how to set up it?

    If I'm following you correctly then you're asking how to set JAVA_HOME on a linux system. Depends on what shell you're using but I'll guess it's bash. I believe the bash shell reads $HOME/.login when you login so you can add the line:
    setenv JAVA_HOME /path/to/java
    I haven't used bash or linux in a long time so I'm not sure if that will work. If it doesn't work, look at the man page for bash and read the part about setting env vars at login.

  • What  is  Persistancy  Class ?

    What is  Persistancy  Class ?..with  Example  .

    Hi Girish,
       There is a way to avoid building a fully object-oriented program while still working with non-object-oriented relational database. The object services layer now provides a <b>persistence framework</b> that closes the object-relational gap.
    You no longer need to write <b>SQL code</b> as objects are transparently loaded from the database when needed. You must create a <b>persistent class</b>. Choose transaction SE24 and create a persistent class; this class must be protected.
    steps :
    Go to se 24 - choose persistence class
    it will be always protected class.
    next screen will give u the persistence button when u click on that it will ask u to
    add the table or struture.
    now u can see two division of the screen where bottom portion of the screen will list uall the fields available and u need to double click and map to the top portion.
    Save the persistence class and hit back button..
    Whenever u create persistence class zcl_example_persist - it will create two classes - zca_example_persist
    and zcb_example_persist automatically
    Where zca_example_persist is the agent class and zcb_example_persist is base agent class..
    Save and activate.
    Activate the whole class. Now that we have a persistent object to access the database table SFLIGHT, we must access it in a program. Here is a small example to read/write data into SFLIGHT using persistent objects.
    REPORT  ZPERSISTENCECLASS.
    data : l_flight type ref to zcl_persist.
    data : l_flight_agent type ref to zca_persist.
    data : l_seatsfree type i.
    data : l_seatsocc type i.
    l_flight_agent = zca_persist=>agent.
    * CATCH CX_OS_OBJECT_NOT_FOUND .
    *ENDTRY.
    *TRY.
    CALL METHOD L_FLIGHT_AGENT->GET_PERSISTENT
      EXPORTING
        I_CARRID = 'LH'
        I_CONNID = '0400'
        I_FLDATE = '20060701'
      RECEIVING
        RESULT   = l_flight
    * CATCH CX_OS_OBJECT_NOT_FOUND .
    *ENDTRY.
    l_seatsfree = L_FLIGHT->GET_SEATSMAX( ) - L_FLIGHT->GET_SEATSOCC( ).
    if l_seatsfree > 0.
    l_seatsfree = L_FLIGHT->GET_SEATSOCC( ) + 1.
    l_flight->set_seatsocc( l_seatsfree ).
    endif.
    There are lots of other methods and techniques that you can use in persistent classes.
    A demonstration of this can be found in program <b>DEMO_CREATE_PERSISTENT</b>.
    <b>DEMO_QUERY_PERSISTENT</b>
    kindly look into below link for screen shot to create persistence class
    http://erpgenie.com/abaptips/content/view/417/38/
    Regards
    Sathish

  • What are condition variables? how do condition variables and monitors work?

    What are condition variables? how do condition variables and monitors work? Isn't condition variables the same as semaphore? After reading their implementaion over and over again..I still don't know how condition variables and monitors work together to provide good synchroniztion.
    Thanks

    I can tell you they have nothing to do with Serialization.
    Are you refering to the Condition class in Java 5+
    Usually you would use either a Condition or use synchronization, so you shouldn't need to use them together.

  • Persistent variable in package

    Hey,
    I am not sure where exactly to ask about this, so if I posted in the wrong forum forgive me.
    My problem is this: I am writing an application which interacts with a remote server using the functions in the utl_tcp package. This works with no problems in testing, but after I put a web interface on it I discovered that what I thought were global variables (defined in the package spec) are being reset every time a new call is made to the server. The interface works by repeatedly calling a certian function in my package which checks the tcp stream (what I want to be my 'global' variable) for any new information coming downstream. When it does this though the stream is gone, the variable has been reset with every request.
    I tested this with a more simple variable too to make sure it just wasnt some quirk of the tcp connection type. What I want to happen in the code is everytime the procedure 'increment' is hit the variable would increase. This is that test code:
    PACKAGE test IS
       testNum number := 0;
       PROCEDURE increment;
    END test;
    PACKAGE BODY test IS
       PROCEDURE increment IS
       BEGIN
           testNum := testNum + 1;
           htp.prn('Current value: ' || testNum);
       END;
    END test;
    After hitting that procedure a few times the output was 1 every time, so it would seem what I had believed to be 'global' variables are actually local to the request, reset every time, and that is not going to work for me. I need some persistance.
    Someone mentioned something to me about storing variables in a session object, but I don't know anything about that (yet)...
    Any help would be appreciated.

    Hey,
    I am not sure where exactly to ask about this, so if I posted in the wrong forum forgive me.
    My problem is this: I am writing an application which interacts with a remote server using the functions in the utl_tcp package. This works with no problems in testing, but after I put a web interface on it I discovered that what I thought were global variables (defined in the package spec) are being reset every time a new call is made to the server. The interface works by repeatedly calling a certian function in my package which checks the tcp stream (what I want to be my 'global' variable) for any new information coming downstream. When it does this though the stream is gone, the variable has been reset with every request.
    I tested this with a more simple variable too to make sure it just wasnt some quirk of the tcp connection type. What I want to happen in the code is everytime the procedure 'increment' is hit the variable would increase. This is that test code:
    PACKAGE test IS
       testNum number := 0;
       PROCEDURE increment;
    END test;
    PACKAGE BODY test IS
       PROCEDURE increment IS
       BEGIN
           testNum := testNum + 1;
           htp.prn('Current value: ' || testNum);
       END;
    END test;
    After hitting that procedure a few times the output was 1 every time, so it would seem what I had believed to be 'global' variables are actually local to the request, reset every time, and that is not going to work for me. I need some persistance.
    Someone mentioned something to me about storing variables in a session object, but I don't know anything about that (yet)...
    Any help would be appreciated.

  • Persistent variables in userForm

    This is probably a stupid newbie question, but I've been unable to solve this or find a solution on these forums or Google...
    The situation: I have a form that has several stages. Depending on variables in the form elements are shown or hidden. The form 'recalculates' a couple of times before the actual 'Save' button can be reached. Form elements (classical HTML From elemenents) are maintained, but variables declared by <defvar> are lost between the 'recalculations'. Values for the resource attributes, like e.g. accounts[Lighthouse].firstname do not get saved until the (IdM) form is actually saved.
    What I want is to have a way to transfer variables between the various stages of the form, but I do not want to use the "Hidden" type of form element. The values should in no way be visible to the end user (not stored in cookies, hidden fields, etc.), but stay on the server side only. I cannot imagine that there is no way to do this.
    Can anyone help me?
    Is it for example possinble to declare a "Hash" or "Array" object in the .jsp code and access that form the form? If so, please explain how.
    Thank you very much in advance!
    Best regards,
    Menno Pieters

    As you mention it, it is generally not a good idea to use <defvar> to maintain variable values between refreshes, because the variable value is lost
    The best practice is to define <Field> without any <Display> clause => this will add entries in the user view that will persist as long as the view is alive (eg : until discarded or committed)
    A field can be any type (string, integer, encrypted, date.. single/multi-valued...)
    If there is no <display> the value is not rendered in the HTML page and remains on the server
    If the value is "static", define it in the <Default> clause (therefore it is calculated only once). If it is updated when the page refreshes, define the value in the <Expansion> as any other field.
    Cyril

  • Persistent variable ..

    Hi,
    I have a question related to user variables.
    The system here has user variable set as persistent in registry it is set to zero.How system will behave incase both routers are down.
    I am facing a issue wherein the emergency is triggered but I don't see ant records in TCD and RCD.
    What can be causes?Any clues?
    THX

    quote:
    Originally posted by:
    Suva1
    Thanks Dan,
    I was looking at scoped variables as well as caching earlier
    but was not sure that I was looking in the right direction. I'll
    have to do some more research to understand how to properly scope
    my variables so that this behaviour does not exist anymore.
    Off the top of my head, if I remember correctly, I would
    differentiate the scoping as form.var vs. url.var, is that right?
    Cheers
    That's correct.

  • Persisting variables to global scope (M spec's 'shared' keyword?)

    Hi,
    I wanted to declare multiple variables I'd like to reuse in a query, and be able to keep them in scope afterwards for use in other queries. The alternative of redeclaring them in each query separately would seem tedious, while individual queries can also
    only return one variable each (be it a table/list).
    I read in the M formula specification that it should be possible to global-scope a variable using the 'shared' keyword, though apparently this was only for use in the 'sections' part of the M specification unimplemented in Power Query itself. Am I missing
    something? Might there be some other way to persist a variable to the shared (global) scope from within a query?

    Thank you for the further clarification on sections; I didn't really know they are still kind of there in the background.
    Reconsidering, I suppose my perceived issue isn't really so bad. I think what I wanted (using M functions from text files like an external library) is pretty well doable, so I've Github'd (https://github.com/tycho01/pquery) what I have for others to try;
    perhaps that may help illustrate my use case a bit. I think I'm actually satisfied now, though I may as well explain better what I was trying.
    What I'm imagining (as an analogy to my experience with Excel VBA) is basically having a larger library of user defined M functions to flesh out the built-in ones, with smaller functions for relatively basic tasks, and mid-level functions building upon those
    and upon each other.
    Considering the (current) effort in adding a bunch of functions to different workbooks, not to mention edit syncing concerns, keeping such all-purpose functions separate from individual workbooks (in analogy to VBA's 'personal' workbook) would seem sensible.
    If that were to work out, eventually it may be preferable if things were to 'just work', in terms of all functions being in scope, so each such library function could freely call other such library functions.
    At present, if you load multiple functions through Expression.Evaluate(), possible in batch through lists/records as you mentioned, they will all be available in the original scope.
    However, with no effective way to pass this around (unless environments?), the loaded functions will not know of each other though. What I do now is to explicitly load used library functions in each function where they are needed. Under this limitation of losing
    scope between functions, it might be ideal to have all available functions loaded only once.
    Reloading in batch (i.e. load the whole library rather than the parts needed) within every new function scope may become less desirable in terms of unnecessary overhead.
    I suppose for the most part my scenario is still largely hypothetical though, so I might as well try and see if the general idea would take off in the PQ community for now. In either case, thank you for your replies.

Maybe you are looking for