2 Replies Latest reply on Nov 24, 2006 12:48 AM by Weston M. Price

    disable connection pool

    Mike Khlu Newbie


      I configure LocalTxDataSource in my jboss-beans.xml

      <bean name="StagingDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
       <property name="driverClass">org.hsqldb.jdbcDriver</property>
       <property name="connectionURL">jdbc:hsqldb:file:test-output/staging</property>
       <property name="userName">sa</property>

      My test accesses to Datatasource through JNDI:
      datasource = (DataSource) new InitialContext().lookup(jdbcUrl);

      and then to connection warper:
      connection = datasource.getConnection();

      connection instanceof WrappedConnection

      and when I close it by

      WrappedConnection puts real JDBC connection to the connection pool.
      But I need to close JDBC connection!!!

      How i can to do this? or How I can disable the connection pooling in jboss-beans.xml? or In which forum I should post this question?


        • 1. Re: disable connection pool
          Weston M. Price Master

          Can you tell me where you got the class


          and what version of JBoss you are using.

          • 2. Re: disable connection pool
            Weston M. Price Master

            Ok, I see, this is an custom class used for POJO/EJB3 based deployments. This was never really meant to be used in this manner.

            If you do not want the connection pooled you would need to use some other form for acquiring your connection. DriverManager.getConnection() would be the most appropriate. A simple wrapper for this functionality should be sufficient. Also, most JDBC vendors provide non-pooled DataSource implementations that you can use directly. You would just set this up as a bean and set the properties that you need.