Database connection remains open after close being called

I am using oracle OC4J as my application server. I am not using connection pool and I am using non-pooled datasource to get connection. The database connection is made at runtime and then closed. I want to test if the users' connection sessions have been killed after they logout the application. But when I checked the table v$session in the database, it shows one connection remaining. I checked my program, the close method has been called. Does anybody know the solution?

Hi Chen,
This is just a suggestion for something to try -- only if you haven't
already tried it, that is!
Try running OC4J in "debug" mode. Here are details on how to do that:
http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
Hope this helps you!
Good Luck,
Avi.

Similar Messages

  • SQL Connections remain open after Crystal Report closes

    I am wirting an interface to use the crystal report viewer to print reports, connecting to a Progress Open Edge 10.1B database.  From our application we declare the application, report, exportoptions and connectionproperties objects and pass these to the crystal reports viewer.  Once the report is printed we release the objects and set their variables for null.  However we are finding that the SQL connection to the database is remaining connected and we can only release the connection by manually going in a disconnecting.
    I have read in forums that people use .dispose or .close to release the connection, however we do not have access to these methods as we do not use .NET.  Are there any methods we can use to disconnect these sql connections?

    Hi Dean,
    Moved to the Legacy Application forums. Likely using the RDC as your report engine.
    You should still be able to close and dispose of the report objects. They are not specific to .NET.
    In VB it would look something like these lines::
        crReport.Close
        Set CrystalActiveXReportViewer1.ReportSource = Nothing
        Set crReport = Nothing
    Once the report is closed it should disconnect from the DB. If you close the application does that disconnect?
    Have you looked on 4GL's site for info on how to?
    Thank you
    Don

  • ODBC connection remains open after disconnect

    Hello,
    in my application I use 2 ODBC connects to 2 different ODBC drivers.
    My problem:
    When I close one connection (with DBDisconnect), the connection on the database remains open until I close the second one.
    Is this a known behavior?
    Is there a way to force the closing or to make it independant of the other connection?
    Regards
    Fred
    Solved!
    Go to Solution.

    As ODBC connections are not inherently included in the CVI environment, I looked up the DBDisconnect function and it says that the DBDisconnect function disconnects the last connected ODBC database. So it is expected behavior.
    Ian M.
    National Instruments

  • RFC Connection remains open after portal logoff

    Hi,
    We have configured Universal Worklist in our EP7 EHP1 SPS4 Portal.
    When a user connects to the Portal and launches the UWL it creates an RFC connection to the backend ECC. However, when the user moves away from UWL iview or logs out or closes the browser the RFC connection in the backend still
    remains and is released only after the timeout value reached as set in ECC.
    Are there any settings on the portal or ECC to release the session immediately once  user moves away from UWL or logs out of portal ?
    Thanks,
    Savy.

    Hi my friend
    It costs time and resources to establish an RFC connection, therefore it is not immediately deleted but maintained by the system to be reused. But in case there're special purpose to control RFCs, here're 2 parameters to do so:
    The parameter gw/gw_disconnect is a timeout in seconds to close the TCP connection between two SAP gateways if there is no RFC connetion on it for the given timeout. But if there is an active RFC connection onit it will not be closed even if there is no traffic on that RFC connection. Thats why you need another parameter.
    The parameter gw/keepalive is used to periodically check all active RFC (and other) gateway connections if there was no traffic on them for the given time.
    Regards,

  • XA connections remain open

    We are using Oracle 9.0.2, JDBC thin driver 9.0.2 and Weblogic 6.1 We create XA
    connections (without pooling) directly from the middle-tier (Weblogic server)
    to the database. We have noticed that these XA connections remain open for an
    arbitrary amount of time after the connection was closed by the middle-tier. Has
    anyone experienced similar problem? Does anyone know what can keep an XA connection
    open after the connection.close() has been issued.
    Thanks in advance, Eugenia

    Eugenia,
    According to the WLS 7.0 release notes in the e-docs site:
    "WebLogic Server applications that use distributed transactions with Oracle
    Server 9.2.0.x are experiencing problems with the Oracle thin driver
    9.2.0.x. For such applications, BEA recommends against using Oracle thin
    driver 9.2.0.x at this time. Instead, use a 9.0.1.X driver, where X is 3 or
    higher. "
    Hope this helps.
    "Eugenia" <[email protected]> wrote in message
    news:[email protected]..
    >
    We are using Oracle 9.0.2, JDBC thin driver 9.0.2 and Weblogic 6.1 Wecreate XA
    connections (without pooling) directly from the middle-tier (Weblogicserver)
    to the database. We have noticed that these XA connections remain open foran
    arbitrary amount of time after the connection was closed by themiddle-tier. Has
    anyone experienced similar problem? Does anyone know what can keep an XAconnection
    open after the connection.close() has been issued.
    Thanks in advance, Eugenia

  • How do i get the download window to remain open after closing firefox browser window

    i sometimes download a bunch of files all at ones then have to go back to review them. but i don't need the browser open to do this just the download window. in older versions the download window would remain open after i closed the browser but i don't see a way to do that anymore?

    You can set the pref browser.download.manager.quitBehavior to 2 on the about:config page.
    See http://kb.mozillazine.org/browser.download.manager.quitBehavior
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

  • Sockets remaining open after connection failure

    Hi - I have a multithreaded application that runs as a daemon (always up) and uses OCI (10.2.0, 64-bit client). If a database connection or query fails for any reason, it is coded to keep on retrying on a set schedule until it succeeds. The application runs on RHEL 4 (64-bit) and is compiled with g++ 3.4.6. (It's nominally C++, but is really what I call "C with objects" as it doesn't use a lot of the standard C++-isms, though there are objects -- the OCI code in question is in a C++ object wrapper that I wrote.)
    Anyway, about 5 days ago, the database where most of the queries are run went down (it's a 10g server; I don't remember the exact version, but since it's down, I'm not sure it matters), and it has not come back up, although the hosts it runs on are up. Meanwhile, my application kept failing to connect and retrying, and the number of queries that this was happening to kept on growing as new ones are added every day. Unknown to me, the failed connection attempts were leaving open TCP sockets to the database that was down, until eventually the maximum open files on the system was exceeded and I was forced to reboot. Twice. (It happened again the next day.)
    From what I can tell, I am properly dropping the handles and such when a connection fails, so why are the sockets staying open? Is there anything that can be done to force the socket to close after a failed connect? This morning I changed all the queries to use a different database (that's actually up), but according to lsof, there are still 56 open sockets to the old (non-working) database, even though none of my program threads are actively trying to connect there anymore.
    The sockets do close, by the way, if the application is stopped and restarted. But they remain open as long as the instance that created them is still running. (I added a periodic restart to clean things up, but I'd really like to fix the problem instead of using a stopgap like this!)
    Sample code is below. This first bit is what is used to connect and log in. (Note that I have this mutex-locked -- I know OCI is supposed to be thread-safe if you use the OCI_THREADED attribute, but I've been having so many issues that I thought it was safer.)
    if (check_err(OCIEnvCreate(&env, (OCI_THREADED), (void *) 0, 0, 0, 0, (size_t) 0, (void **) 0)) != 0)
    fprintf(stderr, "Error allocating OCI environment handle\n");
    return;
    // Allocate error handle.
    if (check_err(OCIHandleAlloc((void *) env, (void **) &err, OCI_HTYPE_ERROR, 0, (void **) 0)) != 0)
    fprintf(stderr, "Error creating OCI error handle.\n");
    return;
    // Allocate server handle.
    if (check_err(OCIHandleAlloc((void *) env, (void **) &server, OCI_HTYPE_SERVER, 0, (void **) 0)) != 0)
    fprintf(stderr, "Error allocating OCI server handle.\n");
    return;
    // Allocate service handle.
    if (check_err(OCIHandleAlloc((void *) env, (void **) &svc, OCI_HTYPE_SVCCTX, 0, (void **) 0)) != 0)
    fprintf(stderr, "Error allocating OCI service handle.\n");
    return;
    [Note: these are snippets from two different functions; this is a C++ wrapper that uses OCI, so the above code is in the database object constructor, and below is a separate login function.]
    // Attach to server.
    retcode = OCIServerAttach(server, err, (text *) curDS, strlen(curDS), OCI_DEFAULT);
    if (check_err(retcode))
    fprintf(stderr, "Error attaching to Oracle server.\n");
    return(retcode);
    // Set server attribute in service handle.
    retcode = OCIAttrSet((void *) svc, OCI_HTYPE_SVCCTX, (void *) server, 0, OCI_ATTR_SERVER, err);
    if (check_err(retcode))
    fprintf(stderr, "Error setting OCI server attribute.\n");
    return(retcode);
    // Allocate session handle.
    retcode = OCIHandleAlloc((void *) env, (void **) &sess, OCI_HTYPE_SESSION, 0, (void **) 0);
    if (check_err(retcode))
    fprintf(stderr, "Error allocating OCI session handle.\n");
    return(retcode);
    // Set username attribute in session handle.
    retcode = OCIAttrSet((void *) sess, OCI_HTYPE_SESSION, (void *) curUser, strlen(curUser), OCI_ATTR_USERNAME, err);
    if (check_err(retcode))
    fprintf(stderr, "Error setting OCI username.\n");
    return(retcode);
    // Set password attribute in session handle.
    retcode = OCIAttrSet((void *) sess, OCI_HTYPE_SESSION, (void *) curPass, strlen(curPass), OCI_ATTR_PASSWORD, err);
    if (check_err(retcode))
    fprintf(stderr, "Error setting OCI password.\n");
    return(retcode);
    // Start session.
    retcode = OCISessionBegin(svc, err, sess, OCI_CRED_RDBMS, OCI_DEFAULT);
    if (check_err(retcode) != 0)
    return(retcode);
    // Set session attribute in service handle
    retcode = OCIAttrSet((void *) svc, OCI_HTYPE_SVCCTX, (void *) sess, 0, OCI_ATTR_SESSION, err);
    if (check_err(retcode))
    fprintf(stderr, "Error setting OCI session attribute.\n");
    return(retcode);
    If any of the above calls returns an error, the next call is to the database object destructor (also mutexed), which looks like this:
    if (connected && svc && err && sess && check_err(OCISessionEnd(svc, err, sess, OCI_DEFAULT)))
    fprintf(stderr, "Oracle - Error ending session\n");
    if (connected && server && err && check_err(OCIServerDetach(server, err, OCI_DEFAULT)))
    fprintf(stderr, "Oracle - Error detaching from server\n");
    if (connected && server && check_err(OCIHandleFree((void *) server, OCI_HTYPE_SERVER)))
    fprintf(stderr, "Oracle - Error freeing server handle\n");
    if (connected && svc && check_err(OCIHandleFree((void *) svc, OCI_HTYPE_SVCCTX)))
    fprintf(stderr, "Oracle - Error freeing service handle\n");
    if (connected && err && check_err(OCIHandleFree((void *) err, OCI_HTYPE_ERROR)))
    fprintf(stderr, "Oracle - Error freeing error handle\n");
    if (connected && env && check_err(OCIHandleFree((void *) env, OCI_HTYPE_ENV)))
    fprintf(stderr, "Oracle - Error freeing environment handle\n");
    Anyone else had this happen? Any insights/help would be greatly appreciated!
    Oh, one more note: though the application is multithreaded, none of the database objects or connections is shared -- each thread makes its own connections and maintains database objects separately. I added the mutex locks because Helgrind was reporting race conditions on handle allocations and deallocations.
    Thanks,
    --Tina                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hmm, I believe I did have an OCIHandleFree on the session handle in an earlier version of the code. I can't remember why I took it out, but I do remember that there was a reason -- it was causing a problem. (Yeah, I know, vague enough for ya?) Anyway, the OCI documentation said that when you call OCIHandleFree on the environment handle, any child handles would be implicitly freed, so I assumed it wouldn't be a problem. Still, I'll try putting it back and see what happens. Thanks.
    Oh, and to answer your question (about netstat), it said the processes were ESTABLISHED. But the Oracle server was down (although the hosts it resided on were up). The connection attempt failed with the error message:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Message was edited by:
    user613364

  • Cursors remained open after closing connection

    I am using OC4J 10g (Application Server) and Oracle10g DB. OC4J is maintaining the connection pool(com.evermind.sql.DriverManagerDataSource). I get the connection from pool and call DB procedure, then close resultset, statement and connection. It closes the opened cursors against resultset. But left some implicit cursors opened and never closed so cursor count is going to increase.
    If i dont use pool no cursor remained open and count is zero. It means the cursors of pooled connections are not closed.
    wait-timeout="60"
    min-connections="5"
    max-connections="100"
    inactivity-timeout="15"
    <property name="stmt-cache-size" value="2000"/>
    Tahir

    Hi Justin,
    Thnx for your reply and you're understanding is correct but the problem I face is when multiple concurrent users access the JSP page from which I'm actually calling the servlet to retrieve the image, the number of cursors being left open increases. As the load on the page increases (i.e. no of usesrs increase) oracle seems to have problems in garbage collecting the open cursors ... which eventually leads it to throw maximum cursors exceeded exceptions.
    Any suggestions ?
    -Athar

  • My Firefox.exe process remain open after I close the browser.If I open it it's says to open a new window.I need to close the process manualy(Ctrl+Alt+del).What can I do?Thanks .

    Need to close the process.

    It does take Firefox a while to shut down; it has to update some databases. But it should take less than a minute.
    In the support article, this problem is called a "hang at exit" because Firefox hangs when shutting down. Maybe something here will help: https://support.mozilla.com/en-US/kb/Firefox+hangs#Hang_at_exit
    Also, sometimes open Firefox windows disappear from the Task Bar. You can use Alt+Tab to switch to them if they remain open.

  • Connection still exists after close

    Hello
    My connection to the database don't disconnect. I have a servlet, in the doGet it will connect to the database(FoxPro). Then I execute a select command. Until here all works fine. Then I close the statement and the resultset, afterwards I close the connect like this: con.close()
    If I now try to open the database with the foxpro programm it can't open the database exclusive! I think its because the connection from doGet is still there.
    If the doPost is executed, it will connect also to the database and execute an Update. Then the servlet fails with a NullPointerException.
    This error occures every time if I make a connection to the database, close it afterwards, and then open another connection and try to make a query. It doesn't matter what a query it is.
    It is because with the close in the doGet is something wrong.
    The con.close() command don't throw an exception.
    The code I wrote is OK. Could it be that the connection is closed, but the user is still connected in the database? Is there a close for the user?
    Or have you an other idea?
    I thank you for your help.
    Sandra Frei

    The con.close() command don't throw an exception.
    The code I wrote is OK. Could it be that the
    connection is closed, but the user is still connected
    in the database? Is there a close for the user?Have you closed your resources in the following order.
    finally{
    irs.close(); //resultset
    st.close(); //Statement
    con.close(); //Connection.
    Lastly try...
    con = null; to mark the connection object for garbage collection.
    Hope this solves your problem

  • Adobe XI remains open after printing from command line

    I am using a program to collect, batch print and delete multiple PDF files.
    The following command line is used to print the files, after which the file is deleted and next file is collected.
         "C:\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe" /T /N FileName.pdf
    I have now upgraded to Adobe XI, however Adobe remains open (and minimized) after sending the print job to the printer, resulting in my programing freezing while waiting to delete.
    Is there a parameter to close Adobe after printing?
    This is rather urgent as we have started rolling out the new Adobe XI.
    OS = Windows7 Prof x64

    Command line parameters are sparsely documented and are officially not supported. What is documented can be found here: http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/intro_to_sdk/DeveloperFAQ.pd f
    I've not seen anything that shows what you want to do.

  • Why do ports remain open after closing Firefox?

    I have noticed recently that several ports associated with Firefox remain open when the Firefox browser is closed. The number of open ports increases each time Firefox is opened and I have seen that the number of open ports has reached to more than 1,000 open ports at a time. The majority of the open ports are outbound TCP using port 443 and I also note a sustained increase in the network traffic after Firefox is closed.
    I have observed ports opened by the Explorer browser and noted that all of the ports opened with Explorer close when the Explorer browser is closed. The Firefox ports remain open when the browser is closed.
    Questions:
    - Should all open ports associated with an open Firefox browser close when the Firefox browser is closed?
    - Does Firefox have a setting that closes all open ports when the Firefox browser is closed?
    - Does XP have a setting that will close all open ports associated with Firefox when Firefox is closed?
    - Should I have security concerns about the accumulating open ports and increased network activity when using Firefox?
    Thanks.

    You can set the pref browser.download.manager.quitBehavior to 2 on the about:config page.
    See http://kb.mozillazine.org/browser.download.manager.quitBehavior
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

  • Database connection dailog opens with missing fields

    Greetings all,
    I have one user who has a couple reports that do not display all the fields in the database connection dialog box when she attempts to refresh the data in a report.
    Normally this dialog box opens with the Datasource, UserID (of the last person who saved data with the report) and Database prefilled, so only the Password needs to be completed or the UserID changed.
    For her (and this is only happening on a couple reports), only the Datasource text box is visible. The datasource is correctly filled in but in order to see the other fields, she needs to click the next button and then click back. Then all three fields - UserID, Password and Database need to be entered.
    This only started in the past couple months and so far is only occuring with 2 reports, both new. Other new reports are acting normally.
    We are using Crystal Reports XI with the latest service packs. Our reports are in a shared folder on the network. So far I have not been able to duplicate this behavior on anyone else' machine.
    Any idea's on what might be causing this or how to correct it?
    TIA,
    Bob

    I would check that persons database client and/or version of MDAC. May also be a permission issue on tables.

  • "file upload" window remains open after selecting a file. Have to "force quit" to get it to go away. How can I fix this?

    Every time I try to upload a file, the "file upload" window remains open and will not go away unless I force quit Firefox. The window stays in front of all other programs and applications. Is this a problem with Firefox or with OSX? Any idea how to solve it? I've tried clearing the cache & cookies, etc. Should I reinstall Firefox or is there a simpler solution?

    On Windows (don't know about Mac), the latest version will always take over the file association, and become the default for indd files. It's impossible to change it.
    But there is a plugin for ID that makes this possible. Never tried it myself.
    https://www.rorohiko.com/wordpress/downloads/lightning-brain-soxy/

  • Connection remains opened even after calling conn.close

    i have a need to copy records from one table in a database (say db1) to another table in another database(say db2). I open connection to both databases, and get a Recordset (say rs1) by executing a query that contains all rows that i have to insert in the database db2. Next i get an empty recordset(rs2) on the table in the database db2 (with locktype batchoptimistic, clientside cursor). i loop on rs1 and for each row in rs1 i insert a row in rs2 and copy the fields. after all rows are done, i delete the rows from db2 that will be affected and do an updatebatch on rs2. then i close the recordsets and the connections
    everything works fine except that the connection with the db2 is not getting closed, neither is it throwing any exception. when i comment the updateBatch code the connection closes normally.
    can anyone please help me out, where am i going wrong.
    thanks
    Vijay Sharma

    Hi,
    There is one more thing that I want to add to the above question. After calling conn.close() I checked the status of the connection and it was not 'OPEN' but when I checked session information through DBA studio it was showing one connection. I enabled trace of Oracle provider for OLE DB. Trace showed that two sessions were opened but only one session was closed.
    Thanks,
    Vijay

Maybe you are looking for

  • Flash video crashes on multiple browsers

    Hi all, My specs: eMachines notebook Intel Core i3 CPU 2GB RAM Windows 7 64 bit Browsers Installed IE8, Firefox 4 and Chrome AVG Free Edition installed Shockwave Flash 10.3.181.4 installed for FF Graphics Driver Intel HD Graphics Driver version 8.15.

  • Ibooks author web links lost when preview to iPad

    Created a long book with ibooks author including links to web sites.  Works fine on Mac version but when I open the book on iPad ibooks, web links are lost and default to apple web site.  What do I do to retain links for iPad version of ibooks?

  • Weird caracthers appearing in the iTunes Registration

    Well, I've just installed the iTunes Software in my PC, and I can update and upgrade my iPod nano all fine. But, when I've tryed to Sing In(Create an Account) at the iTunes Store(using the iTunes), the caracthers of all texts are wrong, like small sq

  • Stopping NT Service Server

    Hello All, My question concerns stopping a managed server once it has been installed and started as an NT Service. What we want to do is to shutdown our server at night in order to do database backups. Once we have our managed server running as a man

  • Changing the topic titles in jeopardy Captivate 8

    Is there a way to change the topic titles in Jeopardy for Captivate 8?