3 Replies Latest reply on Feb 24, 2005 3:10 PM by David Pegram

    Orphan connections...

    David Pegram Newbie

      I've configured a DataSource under JBoss 4.0.1 to connect to an Oracle database.

      I'm in the process of migrating a stand-alone thick application. So far I can successfully create the initial context, get the data source, open a connection and fetch data from the database.

      Unfortunately, the connections are not released to Oracle despite calls to Connection.close(). I can call the close method immediately after opening the connection and subsequent calls to the DB fail. However, after the application exits Oracle still shows an open connection held by JBoss. After running the application several times JBoss can no longer obtain a connection. I assume it has reached some maximum open connection limit. When I reboot the JBoss application server the connections are released.

      Would someone please explain why this occurs or kindly point me the relevant documentation to correct this behavior?

      Thanks!

        • 1. Re: Orphan connections...
          Chirag Patel Newbie

          Calls to Connection.close() don't necessarily close the connection. Rather, they return the connection to the connection pool, and JBoss determines when to release those connections. However, it seems curious that you are running out of connections. I assume your current testing is starting and stopping a single instance of your client?? Also, Please paste your ???-ds.xml so we can have a better idea of what your configuration is.

          • 2. Re: Orphan connections...
            David Pegram Newbie

            Correct, I'm testing the client app via Eclipse which (I believe) only creates one instance of the client at a time. The XML config file is pretty simple. I've attached a copy.

            Thanks for your help!


            <local-tx-datasource>
            <jndi-name>com/icoria/jdbc/DiscoDevDS</jndi-name>
            <use-java-context>false</use-java-context>
            <connection-url>jdbc:oracle:oci:@discodev</connection-url>
            <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
            <user-name>user</user-name>
            password
            <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
            </local-tx-datasource>

            • 3. Re: Orphan connections...
              David Pegram Newbie

              I noticed the XML "password" tags were stripped from the previous post. They do exist in the XML config file.