What is the lifetime of a session?

Hi all,
I am writing a .NET application that queries an Oracle Database. I am altering the Session variable current_schema in order to execute commands with a different default schema than that of the logged in user. The change to current_schema should persist for the duration of the session, but I'm not sure how long this is. Originally I expected it to be the lifetime of the connection, but this is not the case.
The following code illustrates:
public sub getvalue()
Static Dim done As Boolean
Dim daODP As DataAdapter
Dim conODP As New OracleConnection("Data source=oracleInstance;User ID = username; Password = Password")
Dim cmdODP As New OracleCommand("alter session set current_schema = scott", conODP)
daODP = New OracleDataAdapter("Select columnName from TBLNAME", conODP)
If Not done Then
conODP.Open()
cmdODP.ExecuteNonQuery()
conODP.Close()
done = True
End If
conODP.Open()
Dim dsODP As New DataSet
daODP.Fill(dsODP)
conODP.Close()
end sub
The Alter session command is executed only the first time the method is called, however each subsequent call inherits the same 'session' from oracle, because if it didn't then the call would fail. Once the test application is restarted the session is reset.
When is a session created and when is it ended? Is session length a server property? is it dependent on traffic?(eg:timeout) Is it valid for the life of the application?

So, to be clear (I was doing some searching around on connection pooling and sessions just to clarify things in my mind), if I use the default conection pooling enabled then I have to take extra care to ensure that I don't leave anything persistent laying about? For example, package variables set in one transaction could wind up persisting to another transaction by another user if they happen to pick up the connection used by the first user?
Damn, but that really is a pain for anyone with a history of using packages and whose brain just automatically assumes session-persistence for a given user when they're coding - it just simplifies so many things. But I don't particularly care to deal with the overhead of opening and closing connections left and right either. Time-consuming and expensive, especially the way .NET front end users are used to opening and closing them left and right.
Time to do some thinking on this.....

Similar Messages

  • What is the Lifetime of Extended Support of Oracle E-Business Suite Release

    what is the Lifetime of Extended Support of Oracle E-Business Suite Release 11.5.10 .
    Until what time it is supported .
    Regards .

    what is the Lifetime of Extended Support of Oracle E-Business Suite Release 11.5.10 .
    Until what time it is supported .EBS 11i Extended Support Starts December 2010 with Minimum Patching Baselines
    http://blogs.oracle.com/stevenChan/2010/11/ebs_11i_extended_support.html
    11i minimum baseline support
    11i minimum baseline support
    Thanks,
    Hussein

  • Lifetime of a session, created thru SHDB

    Hi,
    What is the lifetime of a session, created through SHDB and what is the use of 'lock date' field in session creation?
    Thanks,
    Parul.

    Hi,
    lock date will restrict the user to process the session till that date.
    if u make the attribute KEEP = 'X' session will be there till any one delete.otherwise it will not be maintained when the session is processed successfully.
    rgds,
    bharat.

  • Lifetime of a session and/or access token

    Hi folks,
    I try to authenticate via API using both session IDs and oAuth access tokens.
    Does anybody know how long such a session ID (retrieved with a SAML assertion) is valid? And, while we are on it: what is the lifetime of an access token?
    Or, from a developers point of view: How can I retrieve the lifetime of both items programmatically after I retrieved them - is it somewhere coded into the response? 
    Thanks & regards
      Mathias

    Hi Mathias,
    I do not know about SAML session IDs, but the lifetime of an OAuth access token is currently not limited (that is, as long as it is not revoked). AFAIK there is no way to retrieve the lifetime. My colleague Ruediger may be able to give you some information on the lifetime of SAML session IDs.
    Simon

  • What are the differences between attributes and variables?

    I am trying to develop a firmer understanding of the difference between attributes and variables. I understand attributes are lexically scoped to a class and variables are lexically scoped to the enclosing block. The lifetime of an attribute is linked to a class' instance. What is the lifetime of a variable? What is the lifetime of variables declared in a script file's top-level?

    It depend on whether the script is running in standalone mode or been called by others (library mode).
    If running as standalone, the variable of the script in the top level exists until the the script exit. If run as library mode, the variable in the top level of the script will never get to execute. Only the function and class available for call.
    Try calling another script with top level variable (place print statement to verify), you realize in library mode, it will never been called. That's why the main method as in Java is never needed because of this reason.

  • What's the difference? series...

    Hi
    What's the difference between
    1) session = request.getSession();
    and
    2) session = request.getSession(true);

    I think getSession(true) and getSession() are the same, i.e. it returns a session object and if one does not exist, it will create a new session object.
    getSession(false) on the other hand will return a session object and if one does not exist, it will return null.

  • What is the difference between Session timeout and Short Session timeout Under Excel Service Application -- session management?

    Under Excel Service Application --> session management; what is the difference between Session timeout and Short Session timeout?

    Any call made from the API will automatically be set to the “Session Timeout” period, no matter
    what. Calls made from EWA (Excel Web Access) will get the “Short Session Timeout” period assigned to it initially.
    Short Session Timeout and Session Timeout in Excel Services
    Short Session Timeout and Session Timeout in Excel Services - Part 2
    Sessions and session time-outs in Excel Services
    above links are from old version but still applies to all.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • What is the proper way to close all open sessions of a NI PXI-4110 for a given Device alias?

    I've found that, when programming the NI PXI-4110 that, if a the VI "niDCPower Initialize With Channels VI" (NI-DCPower pallette) is called with a device
    alias that all ready has one or more sessions open (due to an abort or other programming error) a device reference results from the reference out that has a (*) where "*" is post-fixed to the device reference where and is an integer starting that increments with each initialize call. In my clean up, I would like to close all open sessions. For example, let's said the device alias is "NIPower_1" in NI Max, and there are 5 open sessions; NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4). A simple initialize or reset (using niDCPower Initialize With Channels VI, or, niDCPower Initialize With Channels VI, etc.) What is the proper way to close all open sessions?
    Thanks in advance. Been struggleing with this for days!

    When you Initialize a session to a device that already has a session open, NI-DCPower closes the previous session and returns a new one. You can verify this very easily: try to use the first session after the second session was opened.
    Unfortunately, there is a small leak and that is what you encountered: the previous session remains registered with LabVIEW, since we unregister inside the Close VI and this was never called. So the name of the session still shows in the control like you noted: NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4), etc.
    There may be a way to iterate over the registered sessions, but I couldn't find it. However, you can unregister them by calling "IVI Delete Session". Look for it inside "niDCPower Close.vi". If you don't have the list of open sessions, but you have the device name, then you can just append (1), (2) and so forth and call "IVI Delete Session" in a loop. There's no problem calling it on sessions that were never added.
    However - I consider all this a hack. What you should do is write code that does not leak sessions. Anything you open, you should close. If you find yourself in a situation where there are a lot of leaked sessions during development, relaunching LabVIEW will clear it out. If relaunching LabVIEW is too much of an annoyance, then write a VI that does what I described above and run it when needed. You can even make it "smarter" by getting the names of all the NI-DCPower devices in your system using the System Configuration or niModInst APIs.
    Hope this helps.
    Marcos Kirsch
    Principal Software Engineer
    Core Modular Instruments Software
    National Instruments

  • HT1918 I'm having some issues trying to change my account billing---I have a new debit card and i need to punch in the new number but when i go to edit my info itunes says my 'session has timed out.' i've logged in and out more than once. what's the probl

    i'm having some issues trying to change my account billing---I have a new debit card and i need to punch in the new number but when i go to edit my info itunes says my 'session has timed out.' i've logged in and out more than once. what's the problem?

    Try to change the credit information from your iphone or other ios device. Tap on settings > store > tap Apple ID > tap view account > tap payment information > change

  • What's the best way for a web app to handle logins and sessions?

    I'm deploying in JBoss, using JSF. As is often the case, I keep User information in an entity bean. My question is, what's the best way to handle this bean?
    My inclination is to create a login page with a LoginBackingBean atached to it. When the user attempts to log in, it will see if there is a User entity bean that corresponds to the given name and password. If there is no User bean that matches, obviously we show an informative error screen.
    But what happens if there is a valid user?
    In the plain old Servlet world (without EJB / J2EE) I would just put the User object (it's an object, not an EJB) into the HttpSession, and I would create a Filter that would check for the presence of that User object, and I would map the filter to something like /members/*, and that would be it. I would use Hibernate to persist the User object, and there would also be a filter that creates a Hibernate session and stores it in the Request so that the User object would work and persist.
    How do I do this within the J2EE / EJB world?
    My first thought would be to just do the same thing. Install the User bean into the HttpSession, and create a filter and do all the same stuff. Is that the right way to do it? It would work pretty well with JSF because I could just access things in the normal JSF way: #{user.firstName} would find the "user" object in the HttpSession scope. So that's good.
    One question that comes up from that is if the user makes some change to the User object that is in the Session scope, will the EJB automatically do the right thing and make those changes persistent? Is there anything else I need to do?
    I'm new to the EJB world, but from what I can see so far, it seems like it's the best way to think about a web application.
    Thanks

    hi ,
    i think the best way is to create java beans ,in that bean call your EJB ,
    and check the validation over there.
    and make that bean scope to session.
    in each and everypage try to check the session ,if it is not valid then forward to your login page...
    otherwise continue to give access to him like guest
    Regards,
    AfTaB

  • Can't seem to download any app despite entering the correct password and answering 3 security question but still in the end it comes up the message that my session has timed out no matter what! Please help, many thanks in adv!!

    Can't seem to download any app despite entering the correct password and answering 3 security question but still in the end it comes up the message that my session has timed out no matter what! Please help, many thanks in adv!!

    Try doing it on your computer with iTunes and then sync to your iPad to see if it clears the problem.

  • V 3.6.13 - what has become of 'Restore previous session'? I've lost track of many topics in tags I had open when I had to shut down in advance of a power down by the electricity co. for day-long maintenence work in my area.

    # Question
    v 3.6.13 - what has become of 'Restore previous session'? I've lost track of many topics in tags I had open when I had to shut down in advance of a power down by the electricity co. for day-long maintenence work in my area. Being able to quickly close all tags, knowing one can recover them later is invaluable.

    See:
    * http://kb.mozillazine.org/Session_Restore

  • What is the meaning of "PSEUDO" and "NONE" in v$session table.

    Hi
    What is the meaning of "PSEUDO" and "NONE" in v$session table.
    V$SESSION:
    SERVER      VARCHAR2(9)      Server type (DEDICATED| SHARED| PSEUDO| NONE)
    thanks
    siva

    PSEUDO is the server column's value of killed sessions, until they are cleaned up by PMON.
    A dedicated server session will always have DEDICATED as server value, while a shared server session has SHARED when it's active, and NONE when it's inactive.

  • What is the best method to store session variables

    As the title says, what is the best method to store session
    variables in a Production environment?
    I have been reading the posts on sessions and have been
    getting different ideas on where to store session variables, in a
    db, registery, cookies etc etc
    Can someone clarify possible best practice on this matter?
    Matrix

    From my experience, db is the best to store client variable
    data. Registry will cause you trouble in future (when data gets
    overloaded) and cookies will not serve the purpose for a few % of
    your users.

  • What are the steps to setup an HTTP Session replication clustering in oc4j9

    what are the steps to setup an HTTP Session replication clustering in oc4j9.0.5

    Are you sure you have the correct version number for OC4J? Is this a standalone OC4J instance, if it then the steps involved are different from the full stack. Please check the Higher Availibility guide in the documentation on OTN.
    Deepak

Maybe you are looking for

  • Adobe PSE 8 not working at all! Help please!!!!!

    HI, I have a fully licesned copy of PSE8 which has suddenly and inextricably stopped working, it loads fine and then crashes as soon as anything is clicked on. I have uninstalled and reinstalled without success. I am working on a macbook pro with sno

  • How do you change the default email client (Mail) to Outlook when sharing?

    In iPhoto I used Outlook as the default email to forward photos to friends.  How do you change it from Mail in Photos to Outlook?

  • Apex_collection not being updated?

    Dear all, I have created a collection. When i fill a value and click on the 'vorige' button, i'm being diirected to a different page. When i come back to the page with my collection, I don't see the values I've inserted. I have searched the forum, an

  • How to reimplement the handleUnload javascript method ?

    Hi all, we are facing an issue here with a generated BPS application(using BPS_WB) which is integrated in another BSP application (cProjects). In fact, often, users are clicking on another tab in cProjects, and they are losing the data they were crea

  • Passing multiple values to web service and retrieving results

    Post Author: mwong CA Forum: Xcelsius and Live Office I'm trying to use this webservice to make a stock quote xcelsius widget: http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx The input is ticket symbol and can be separated by comm