Intermittent JDBC connection

Discussion in 'Java' started by teser3@hotmail.com, May 25, 2010.

  1. Guest

    I am connecting to Oracle 10g RAC using JDBC in Tomcat 6.0.20.
    It works around 50% of the time. When it doesnt work it shows this
    error message:
    IO exception: The Network Adapter could not establish the connection.

    Here is my JDBC String:
    jdbc:eek:racle:thin:mad:(DESCRIPTION=(LOAD_BALANCE=on)
    (ADDRESS=(PROTOCOL=TCP)
    (HOST=170.11.5.111) (PORT=1521)) (ADDRESS=(PROTOCOL=TCP)
    (HOST=170.11.5.112)
    (PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=service) (FAILOVER_MODE
    =
    (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY =
    5) )))


    The above Description parameters I use in my tnsnames.ora and can
    successfully connect to the Oracle RAC using SQL Plus with no issues.
    I can also successfully ping to the IP addresses with no issues.

    I also played around with the JDBC string and added (FAILOVER=ON) but
    still have same issues.

    Please advise.
     
    , May 25, 2010
    #1
    1. Advertising

  2. wrote:
    > I am connecting to Oracle 10g RAC using JDBC in Tomcat 6.0.20.
    > It works around 50% of the time. When it doesnt work it shows this
    > error message:
    > IO exception: The Network Adapter could not establish the connection.
    >
    > Here is my JDBC String:
    > jdbc:eek:racle:thin:mad:(DESCRIPTION=(LOAD_BALANCE=on)
    > (ADDRESS=(PROTOCOL=TCP)
    > (HOST=170.11.5.111) (PORT=1521)) (ADDRESS=(PROTOCOL=TCP)
    > (HOST=170.11.5.112)
    > (PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=service) (FAILOVER_MODE
    > =
    > (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY =
    > 5) )))
    >
    >
    > The above Description parameters I use in my tnsnames.ora and can
    > successfully connect to the Oracle RAC using SQL Plus with no issues.
    > I can also successfully ping to the IP addresses with no issues.
    >
    > I also played around with the JDBC string and added (FAILOVER=ON) but
    > still have same issues.
    >
    > Please advise.


    You're connecting to one of two ports, and it works 50% of the time. What
    happens if you connect to only one of the ports?
     
    Mike Schilling, May 25, 2010
    #2
    1. Advertising

  3. Tom Anderson Guest

    On Mon, 24 May 2010, Mike Schilling wrote:

    > wrote:
    >> I am connecting to Oracle 10g RAC using JDBC in Tomcat 6.0.20.
    >> It works around 50% of the time. When it doesnt work it shows this
    >> error message:
    >> IO exception: The Network Adapter could not establish the connection.
    >>
    >> Here is my JDBC String:
    >> jdbc:eek:racle:thin:mad:(DESCRIPTION=(LOAD_BALANCE=on)
    >> (ADDRESS=(PROTOCOL=TCP)
    >> (HOST=170.11.5.111) (PORT=1521)) (ADDRESS=(PROTOCOL=TCP)
    >> (HOST=170.11.5.112)
    >> (PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=service) (FAILOVER_MODE
    >> =
    >> (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY =
    >> 5) )))
    >>
    >>
    >> The above Description parameters I use in my tnsnames.ora and can
    >> successfully connect to the Oracle RAC using SQL Plus with no issues.
    >> I can also successfully ping to the IP addresses with no issues.
    >>
    >> I also played around with the JDBC string and added (FAILOVER=ON) but
    >> still have same issues.

    >
    > You're connecting to one of two ports, and it works 50% of the time.
    > What happens if you connect to only one of the ports?


    By 'port' do you mean 'address'?

    I'd get in touch with your network administrator, and also your DBA. It's
    unlikely to be anything in the java, since it does work some of the time,
    so there's not a lot you can do to debug this on your own.

    It could be the DB hitting a connection limit and refusing connections;
    i've had that happen, although with Oracle 11 the error you get is
    'java.sql.SQLException: Io exception: Got minus one from a read call',
    which is not what you get. This looks more like a problem i had recently
    where the local DNS server was on the fritz, and some connections to
    databases would randomly hang and then fail. So, note the time when this
    problem occurred, and ask the DBA to check the Oracle logs for anything
    weird happening at that time, and ask the network admin to check his logs
    similarly, and to have a quick check for anything which could be causing
    this problem.

    tom

    --
    Vive la chimie, en particulier, et la connaissance en general. --
    Herve This
     
    Tom Anderson, May 25, 2010
    #3
  4. Tom Anderson wrote:
    > On Mon, 24 May 2010, Mike Schilling wrote:
    >
    >> wrote:
    >>> I am connecting to Oracle 10g RAC using JDBC in Tomcat 6.0.20.
    >>> It works around 50% of the time. When it doesnt work it shows this
    >>> error message:
    >>> IO exception: The Network Adapter could not establish the
    >>> connection. Here is my JDBC String:
    >>> jdbc:eek:racle:thin:mad:(DESCRIPTION=(LOAD_BALANCE=on)
    >>> (ADDRESS=(PROTOCOL=TCP)
    >>> (HOST=170.11.5.111) (PORT=1521)) (ADDRESS=(PROTOCOL=TCP)
    >>> (HOST=170.11.5.112)
    >>> (PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=service) (FAILOVER_MODE
    >>> =
    >>> (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY
    >>> = 5) )))
    >>>
    >>>
    >>> The above Description parameters I use in my tnsnames.ora and can
    >>> successfully connect to the Oracle RAC using SQL Plus with no
    >>> issues. I can also successfully ping to the IP addresses with no
    >>> issues. I also played around with the JDBC string and added
    >>> (FAILOVER=ON)
    >>> but still have same issues.

    >>
    >> You're connecting to one of two ports, and it works 50% of the time.
    >> What happens if you connect to only one of the ports?

    >
    > By 'port' do you mean 'address'?


    Two TCP ports: Both 1521 on 170.11.5.111 and 1521 on 170.11.5.112. I'm
    wondering if only one of themn is answering.
     
    Mike Schilling, May 25, 2010
    #4
  5. Tom Anderson Guest

    On Tue, 25 May 2010, Mike Schilling wrote:

    > Tom Anderson wrote:
    >> On Mon, 24 May 2010, Mike Schilling wrote:
    >>
    >>> wrote:
    >>>> I am connecting to Oracle 10g RAC using JDBC in Tomcat 6.0.20.
    >>>> It works around 50% of the time. When it doesnt work it shows this
    >>>> error message:
    >>>> IO exception: The Network Adapter could not establish the
    >>>> connection. Here is my JDBC String:
    >>>> jdbc:eek:racle:thin:mad:(DESCRIPTION=(LOAD_BALANCE=on)
    >>>> (ADDRESS=(PROTOCOL=TCP)
    >>>> (HOST=170.11.5.111) (PORT=1521)) (ADDRESS=(PROTOCOL=TCP)
    >>>> (HOST=170.11.5.112)
    >>>> (PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=service) (FAILOVER_MODE
    >>>> =
    >>>> (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY
    >>>> = 5) )))
    >>>>
    >>>>
    >>>> The above Description parameters I use in my tnsnames.ora and can
    >>>> successfully connect to the Oracle RAC using SQL Plus with no
    >>>> issues. I can also successfully ping to the IP addresses with no
    >>>> issues. I also played around with the JDBC string and added
    >>>> (FAILOVER=ON)
    >>>> but still have same issues.
    >>>
    >>> You're connecting to one of two ports, and it works 50% of the time.
    >>> What happens if you connect to only one of the ports?

    >>
    >> By 'port' do you mean 'address'?

    >
    > Two TCP ports: Both 1521 on 170.11.5.111 and 1521 on 170.11.5.112.


    Oh, i see, you're using the word 'port' in the way it's defined in the
    specifications. How unusual :).

    > I'm wondering if only one of themn is answering.


    Definitely something to check.

    tom

    --
    Postmodernism's refusal of master narratives is a neat dodge, but doesn't
    get it out of the problem that it offers a master narrative. A teapot
    with 'this is not a teapot' stencilled on the side will still hold your
    PG Tips. -- G'
     
    Tom Anderson, May 26, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith Wansbrough

    Re: jdbc help:sun.jdbc.odbc.JdbcOdbcDriver

    Keith Wansbrough, Aug 16, 2004, in forum: Java
    Replies:
    0
    Views:
    756
    Keith Wansbrough
    Aug 16, 2004
  2. Betty
    Replies:
    1
    Views:
    9,872
    Juha Laiho
    May 21, 2005
  3. Replies:
    0
    Views:
    326
  4. Ben Clackson

    Intermittent "Underlying Connection Was Closed"

    Ben Clackson, Dec 5, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    134
    Ben Clackson
    Dec 5, 2003
  5. Dan
    Replies:
    9
    Views:
    254
    Bob Barrows [MVP]
    Apr 13, 2007
Loading...

Share This Page