0 Replies Latest reply on Mar 25, 2002 10:54 AM by Walter Collazzo

    jboss 2.4.4. databasePoll getConnection

    Walter Collazzo Newbie

      Hi,
      I have this problem: i want connect to a oracle database from a servlet

      my jboss.jcml configuration is


      oracle.jdbc.driver.OracleDriver






      tradePool
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

      jdbc:oracle:thin:@10.78.0.13:1521:dtrade
      1200000
      xxx
      xxx
      false
      false
      false
      true
      120000
      1800000
      false
      true
      1.0
      0



      ibankPool
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

      jdbc:oracle:thin:@10.78.0.13:1521:dibank
      1200000
      xxx
      xxx
      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0


      my java code at init() method is

      ic = new InitialContext();
      dsibank = (DataSource)ic.lookup("java:/ibankPool");
      dstrade = (DataSource)ic.lookup("java:/tradePool");
      Connection conDATA = dsibank.getConnection();
      Connection conTITO = dsibank.getConnection();
      ...

      this section run correctly

      if the connection shutdown I restore it in the service method:

      if (conDATA == null )
      conDATA = dsibank.getConnection();
      ...
      if (conTITO == null )
      conTITO = dstrade.getConnection();
      ...

      statement stmt = conDATA.createStatement();
      ... (ok)

      statement stmt1 = conTITO.createStatement();
      ... (ko)

      ERROR: connection reset by peer ... NOT restore a connection.

      Have you same idea ?
      Walter.


      conDATA run correctly bu conTITO