0

I am using the DBCP component of the Apache Commons library to connection to an Oracle database. I have created a BasicDataSource object and set the MaxWait time to two minutes. However when I call the "getConnection" method to get a connection it never returns or times out. I am try to connect to an Oracle 12.1.0.2 database. What could the cause of this be ? Thanks.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
lgriffin
  • 99
  • 1
  • 7

1 Answers1

0

There can be many reasons like: A firewall between the client and the server. A odbc driver that is too old to be accepted by the database. Incorrect connection details. Wrong driver. Using a database user that has no access.

Some kind of instrumentation can help.

First things to check: is the port open on the io that is used? Is a listener waiting there to handle my connection attempt? Next step is to check the connection with a client that is known to work: sqlplus. If the sqlplus connection works, your jdbc client also makes a chance.

  • Thanks for you response. I know the firewall isn't an issue and I have tried different versions of the OJDBC driver. The max active sessions configured in the BasicDataSource is set to 33 and the max wait is two minutes, so I would expect the first 33 connections to return and any other connections to timeout after two minutes if no connections are freed in the connection pool. I created a test app with the same settings and it does timeout with an exception as expected but in our main application it is not timing out. – lgriffin Jun 30 '21 at 13:38