How to approach a “Got minus one from a read call” error when connecting to an Amazon RDS Oracle instance

前端 未结 5 1660
甜味超标
甜味超标 2020-11-27 16:52

I\'m running Oracle 11GR2 on an Amazon RDS instance. occasionally I get an IO Error: Got minus one from a read call when making a call to DriverManager.ge

5条回答
  •  一向
    一向 (楼主)
    2020-11-27 17:28

    We faced the same issue and fixed it. Below is the reason and solution.

    Problem

    When the connection pool mechanism is used, the application server (in our case, it is JBOSS) creates connections according to the min-connection parameter. If you have 10 applications running, and each has a min-connection of 10, then a total of 100 sessions will be created in the database. Also, in every database, there is a max-session parameter, if your total number of connections crosses that border, then you will get Got minus one from a read call.

    FYI: Use the query below to see your total number of sessions:

    SELECT username, count(username) FROM v$session 
    WHERE username IS NOT NULL group by username
    

    Solution: With the help of our DBA, we increased that max-session parameter, so that all our application min-connection can accommodate.

提交回复
热议问题