5 Replies Latest reply on Apr 2, 2003 12:20 AM by davidjencks

    Reconnecting after RDBMS failure

    cerber

      Hi.
      Currently using JBoss 3.0.2 and Oracle 8.1.7 on Suse 7.3 as RDBMS .
      I've configured connection pool using the example from docs/examples/jca/oracle-service.xml Everything goes well until the RDBMS failure (Oracle has memory leaks in jdbc requests handling). I restarted the database without shutdowning JBoss. I couldn't execute any SQL statement after that. Here's SQLException I've got:
      Connection reset by peer: socket write error.
      The following abstract shows how do I get Connection from the pool before sql statement execution:
      InitialContect ic = new InitialContext();
      DataSource ds = (DataSource)ic.lookup(jndiName);
      Connection conn = ds.getConnection();

      After getting SQLException:
      conn.close();

      Abstract from oracle-service.xml:

      0
      50
      5000
      15
      ByContainer

        • 1. Re: Reconnecting after RDBMS failure
          davidjencks

          There's no easy fast way to do this automatically that I can think of.

          You should be able to throw out the old connections by stopping and starting the pool mbean in the jmx-console.

          • 2. Re: Reconnecting after RDBMS failure
            cerber

            Thank you David for your answer.

            I'm sure there should be an easy way to resolve this problem. I hope so. In other case there's no much sence in connection pooling... Well, I mean load balancing, fail over etc.

            • 3. Re: Reconnecting after RDBMS failure
              sun100

              > There's no easy fast way to do this automatically
              > that I can think of.
              >
              > You should be able to throw out the old connections
              > by stopping and starting the pool mbean in the
              > jmx-console.

              What happened to InvalidateOnError attribute?

              • 4. Re: Reconnecting after RDBMS failure
                paul91801

                Can you show how can I get this example (link) please. It will be greately appreated.

                • 5. Re: Reconnecting after RDBMS failure
                  davidjencks

                  it's in every binary distro and source download
                  binary: docs/...

                  source: connector/src/etc/example-config

                  There are several improvements recently.

                  1. By including the OracleExceptiionsSorter, many errors will result in the connection being closed.

                  2. you can specify sql to be executed each time before the cx is handed out using the TestValidConnectionSQL. slow but fairly effective.