Persist Database connection over user's session

On portal 3.0.9 with JPDK v1 I have a web provider that has a jsp portlet. The portlet has multiple pages which are navigated useing a parameter specified with the pageParameterName tag in the provider.xml. Each page needs to be able to access the database and to allow a rollback for all a users actions until a certain page is visited I need a way for all the access to be done through one database connection.
Putting the dbOpen tag in the event:session_OnStart tag of my globals.jsa file doesn't work (I'm not sure the event:session_OnStart is even executed) and trying to create the connection once with the scope="session" creates an error. Any help would be appreciated.

Generally speaking, persisting a connection over a users session is a BAD idea. If you really need to do it you simply be able to add the Connection object to the session. However, I would strongly recommend that you review your model because it will not scale.

Similar Messages

  • Servlets and Persistent Database Connections

    I'm looking at building an application using
    java Servlets.
    My Application will consist of many individual Java Servlets.
    I want to ensure that there is a persistent database connection so that the users do not have to log on again when a page generated via Servlet1 contains a URL to Servlet2....
    null

    Look at the Http session class in the Servlet specification. It will maintain state for you across client requests.

  • Keeping Database-Connection over several JSPs

    Hi all,
    when creating a database-connection (Oracle 8.x) with JDBC 2, Tomcat Engine, I encountered the problem, that the connection has been lost after forwarding to another JSP.
    What I read from some other forums, there seem to be 2 major ways of how to keep the connection:
    - session vars
    - connection pool
    I feel for our project session will be a approbiate solution, so can you tell me more about it (technical implementation)???
    Thanks & Rgds.,
    Rainer

    you have to declare a bean variable with session scope, like this:
    jsp:useBean     id="object-name"
         scope="session"
         type="type-of-object"     
         class="fully-qualified-classname"
         beanName="fully-qualified-beanName"
    />
    for more infos see (for example) http://www.stardeveloper.com/articles/display.html?article=2001072001&page=1

  • Overly Persistent Database Connections

    When we "disconnect" a connection, is it truly gone?
    Because I'm thinking it may not be really gone until we leave sql developer.

    Finally had a chance to properly test this.
    The connections do appear to be removed upon disconnecting.
    However, I experienced a number of "false disconnects".
    By that, I mean, I told sql developer to disconnect from a connection, saw no warning/error message saying it did not disconnect, but the disconnect did not take place. The connection remained in effect and the connection list in the tree continued to show it as connected.
    On several occasions, I told it to connect but it did not. Ditto for lack of warning/error message and for the connection tree showing it as disconnected.

  • Database connection problem SQL Error: 20, SQLState: 61000

    we are doing stress test on our new web site that uses vaadin framework and hibernate. Our application/web server is apache tomcat and maximum thread number is adjusted to 750.
    we are using jmeter for stress test and when we send 500 user scenario (approximately 15 - 20 database connection per user) in 30 seconds
    we are encountered the following error:
    *14:43:10,502 WARN JDBCExceptionReporter:233 - SQL Error: 20, SQLState: 61000*
    *14:43:10,503 ERROR JDBCExceptionReporter:234 - The Network Adapter could not establish the connection*
    but if we send 500 user in 45 seconds there is no problem, jmeter test is completed with 100% success. even if we send 900 user in 120 or 180 second it is OK.
    it seems that there is a DB related parameter that we could not handle properly or maybe operating system limitation (windows 2008 R2).
    any help will be appreciated. thanks in advance.
    gokhan
    Edited by: gokhangulgezen on May 31, 2011 6:38 AM

    It's the DBMS. Oracle particularly can react this way when there are too many connection requests
    coming in, whether from multiple threads at once, or even from one thread in a tight loop. I do
    not know if there's a way to moderate/adjust this. I typically recommend using connection-pooling,
    and to do as much as possible to populate the pool before there is application load.
    Joe

  • Database connection pooling in ADF causing db procedure calls to use different transaction or session

    We have developed an application using JDev Version 11.1.2.1.0 and the database is oracle 11g EE.
    We have many database procedures or function calls from the model (AMImpl.java, VORowImpl.java) and the commit does not happen in the database and it happens from ADF. The database procedures are called in some valueChangeListnener and these procedures use the same transaction or session database session when called and update some records in some tables that are displayed in pages.
    We started using connection pooling recently in our ADF application,  -Djbo.doconnectionpooling=true -Djbo.txn.disconnect_level=1. When using connection pooling, we noticed that the database procedure calls use a different trasanction or different database session and the data or records that these procedures update is lost.
    After removing the connection pooling, we noticed that the procedures again started using the same transaction or same database session and was working fine.
    I want to know why this connnection pooling caused this issue and is there any fix for this when using connection pooling?

    Take a look at
    http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcampool.htm#CIHCHHEA
    What You May Need to Know About Database User State and jbo.doconnectionpooling = true
    As you can see:
    "At the end of the request when the application module is released back to the application module pool, that application module pool releases the JDBC connection it was using back to the database connection pool. It follows that with jbo.doconnectionpooling set to true the application module instance in the pool may have a completely different JDBC connection each time you check it out of the pool"
    So, the best you can do, is to revert jbo.doconnectionpooling to false.

  • Session scope/Database connection

    Hi y'all!
    I got some questions about session scope and database connections:
    I'm using a bean called dataBase. With this bean i open a database connection and execute some sql statements. the bean has page-scope, which means, as far as i know, the bean will be destroyed after the user leaves the current page.
    but what happens with my dataBase connection?!? could it be possible that it is still active after the bean was destroyed? so should i close my database connection manually or will it close automatically when the bean is beeing destroyed?
    thanks for your help!

    You should explicitly close the connection. One way is to use the finally clause to ensure that the connection is closed even if your code throws an exception.

  • Different database connection or proxy user change

    Hi forms guys,
    in everyday life I am fulltime DBA, so please forgive my spare forms word pool.
    Our users open a forms application that displays a menu with forms applications the user has access to. Users can then click on the menu items and another form pops up. Now having reviewed the code, I can say that the opening of the new forms is done by calling the builtin OPEN_FORM. As parameter "SESSION_MODE" for this function, "SESSION" is supplied. If I understand correctly, this means that another session using THE SAME username/password/connectionstring is created (for the purpose of parallel transactions in parent and child form).
    At the moment each and every user (~400) has it's own database account which has roles (depending on the applications they are granted access to) assigned and also sometimes owns dblinks and synonyms. We want to get rid of them by storing the credentials in OID and just create ONE single application user for every application we host. This user shall contain all nescessary objects such as dblinks and private synonyms.
    The enduser then logs in using the proxy mechanism. For example if user XYZ (defined in OID) wants to start application ABC, then he/she connects like XYZ[ABC_APPUSER]/XYZPASSWD. This must occur when the form opens, directly after the OPEN_FORM call.
    Now my question: Is this possible somehow? Is there a way to have different database connections within a single forms window, if there are different forms? Or is it possible to make a switch to another proxy user within forms? e.g. JDBC has the ability to quickly switch to an other proxy user, without having to re-establish the whole session.
    All I have read so far tells me, that it is not possible. But I would really like to hear that acknowledged by experts. Also other, perhaps better ideas for our intention are welcome.
    Kindest regards
    Matschbirne

    Not really sure how to answer your question other than to say that from within your form's pl/sql you can connect and disconnect as often as you like programatically. However, you can only have one connection at a time (as far as I know). So if you connect as SCOTT and later want to do a login as FRED, you can do so, but SCOTT will no longer be connected.
    Forms does support using Oracle SSO, but for the most part cannot directly access OID. Also, the db login information needed by Forms (when using SSO) is stored in a RAD (Remote Access Descriptor) in OID. The RAD behavior is unique to Forms and Reports. For each SSO user there is a related RAD. At the moment, there is no provided way to have RAD groups (e.g. Admin, Sales, Guests, etc). So each user get their own RAD.
    If you are using Forms 11.1.x, Forms now supports db proxy users.
    More information about SSO and Proxy users with Forms can be found in the Forms Deployment Guide:
    http://docs.oracle.com/cd/E24269_01/doc.11120/e24477/sso.htm
    In the code, you can control the connection using the LOGON, LOGOUT, and LOGON_SCREEN built-ins. Refer to the Forms Builder online help for details on how to use these.

  • Reg: Error while connecting to a remote database as SYS user.

    Hello all,
    When i try to connect to a database as SYS user i'm getting the error as
    ora-01017 invalid username/password logon denied
    But it is logging from the local system where the oracle is installed.
    I created the password file and checked the contents in v$pwfile_users.
    The result is " no rows selected".
    so when i try to grant sysdba to sys user
    grant sysdba to sys;
    i'm getting error as,
    ORA-01994: GRANT failed: password file missing or disabled
    Please help me in resolving this.
    Regards,
    Konda

    I created the passwordfile using the command below,
    orapwd.exe file=E:\app\Administrator\product\11.2.0\dbhome_1\database\PWDfile.ora force=y entries=30 password=<sys_password>
    is this okay...??

  • Run Labview as different windows user (for database connectivity)

    I have to connect to a corporate remote MSSQL-Database on the network, using the database connectivity toolkit for LabVIEW.
    The db-authentification is realized checking the windows user (ads) who acceses the datebase (not a database user / password which is standard in the database vis)
    Therefore I have to run LabVIEW as the defined windows user, different than the logged in user on the pc.
    Is that possible to realize with LabVIEW?
    Other Windows-tools allow to define the windows user/password which "run" an application - how can I do that with LabVIEW?

    Hi Zav.  There is a windows command 'runas' which _may_ let you do what you want; I haven't
    tried what you need to do, but is has worked for other tasks for us.  Try 'runas /?' for the switches.
    You will have to build your LV program into an executable, then use runas to launch it.  Is there
    a reason you can't just login to Windows as the required user?
    If you can get your db admin to allow dbuser/password authentication that would be a much better
    way to go.
    Matt

  • Error in Database Studio: Connect to user management database not possible

    Hello,
    Everytime I start the Database Studio 7.9 (the latest version 7.9.08.18) it show me the following error:
    Could not access to user management
    See Window -> Show View -> Event Log Viewer for more details
    In Event Log Viewer I see the following information/errors/warnings:
    Connect to user management database not possible. Try to use/create local default user management
    Undefined result row
    This error always appears in anything I do in the Database Studio application!
    How can I correct this error? Can you help me please?
    Any tips?
    Kind regards,
    samid raif

    Hi Samid,
    Delete the folder document & settings -> all users -> sdb
    Post this check the results.
    Regards,
    Deepak Kori

  • Unable to connect to database as apps user

    ORA-12203: TNS:unable to connect to destination .
    when iam trying to connect to database as apps user iam getting this error..
    as sysdba i could connect...database listener is up and application services are also up....but couldnt connect to database as apps user? how to resolve this issue.

    ORA-12203: TNS:unable to connect to destination .
    when iam trying to connect to database as apps user iam getting this error..What is your EBS release? OS? DB version?
    as sysdba i could connect...database listener is up and application services are also up....but couldnt connect to database as apps user? how to resolve this issue.Are you trying to connect remotely? Can you connect from the application tier node as apps user?
    Please run Autoconfig on both tier nodes, bounce the services and check then.
    Thanks,
    Hussein

  • ODI database connection - session question

    Hi,
    I have a package, where I have used a procedure.
    In my procedure, I open a database connection.
    My question is - In my next procedure - will I be able to use my same database connection which I created in previous step?
    Re-phrasing the question - for any number of database transaction happening in a package, will ODI opens multiple database connection per step or will there be only one single database connection?
    Thank you,
    Paras

    I believe its one per session so one connection inside the package. I think you should be , although i have not tried it practically.

  • Making database connection to externally identified user

    I try to make a database connection using an externally identified user.
    I have not succeeded so far.
    In Oracle Designer it is possible to just fill in /@SID in the username field.
    Somebody knows a workaround ?
    regards,
    Timo Schijf

    Timo,
    This question is not related to JHeadstart. Can you please post the question on the JDeveloper forum?
    Thank you,
    Steven Davelaar,
    JHeadstart Team.

  • Connecting Sysbase database from OID user

    Does OID allow to connect to sybase or any other relational database using OID user/ Enterprise User?. I will appreciate if someone can point me to the right link or provide me some step by step procedure.
    I have setup the heterogenous connectivity and I can connect to Sybase database using database link etc.
    Thanks
    Suhail

    can u please let me know the steps of how to connect the heterogeneous connectivity

Maybe you are looking for

  • Have a ipod nano 5th gen., keep getting error message 13019!!!

    I have an ipod nano, 5th gen. Yesterday when I tried to sync music I received error code 13019. I tried unsyncing music, resyncing,...finally ended up restoring, resetting..nothing worked. All updates are current on itunes and ipod. This has never ha

  • Disable a control using conditions.

    I am trying to disable a control on the front panel based on the status of other contorl and indicator states. Is there an easy function that I can call to enter the allowable conditions versus the non-allowable ones?

  • Is Adding a Sound at the Very End Possible?

    Hi, I was just wondering, for the last slide of my presentation, I have an audio effect that I would like to have keep going even though the slide has transitioned out. Is this possible?

  • Anyconnect and preshared keys

    Is it possible to use the anyconnect client and still use preshared keys?  I'm trying to remediate a PCI issue that requires removing IKEv1, and preshared key, and disabling aggressive mode. Will any of this break Anyconnect?  Your assistance in appr

  • I'm missing the Apple Mobile Device USB Driver.. iPhone isn't recognized in iTunes?

    I have tried re-installing itunes, restarting computer/ phone, disabling security software, different USB cords, etc.. I followed a page on apple (http://support.apple.com/kb/TS1538) and concluded I am missing the driver but none of the suggestions h