1 Reply Latest reply on Jun 26, 2008 5:09 AM by Vicky Kak

    inactive connections are not closed in oracle even i mentine

    Ganesh P S Newbie

      I am using a pooled connection in my web application using jboss specific configuration file oracle-ds.xml the entries of the file is :

      <local-tx-datasource>
      <jndi-name>OracleDS-QA</jndi-name>
      <connection-url>jdbc:oracle:thin:@opi049.nod.comp.com:1551:prodqa</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>xxx</user-name>
      123
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
      <new-connection-sql>select 1 from dual</new-connection-sql>
      <check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
      <min-pool-size>10</min-pool-size>
      <max-pool-size>100</max-pool-size>
      <idle-timeout-minutes>1</idle-timeout-minutes>

      <type-mapping>Oracle8i</type-mapping>

      </local-tx-datasource>

      In my application I am getting the connection by datasource as :

      Context ctx=new InitialContext();
      ds = (DataSource) ctx.lookup(jndiName);
      ..
      ds.getConnection();

      When I complete load testing with 50 users I found 50 inactive connections at oracle side

      [ SELECT COUNT(*) FROM v$session WHERE osuser='tsering' AND status='INACTIVE' ]

      and when i complete single transation after that my inactive conn incremented by 1.
      I am not aware why the inactive connections are there at oracle side. Is there any mechanism to remove these inactive connections from oracle side.

      I know that when we call con.close() method in a pooled connection the connection is returned back to pool but I didn't know why it is not using the inactive connection for a new connection request it is creating a new one.