java.sql.SQLException: Got minus one from a read call
Symptom)
When I ran servlet web application, I got the error message "Got minus one from a read call".
Root Cause and Solution)
This one is quite complicated problem. So there are lots of reasons why this error happened. First of all, it is because that connection pool ran over the number of limit.
You can just adjust datasource configuration.
Following is the cases that you can try.
1. Configure [minIdle] value lower than that of current value.
2. Configure same value with [maxActive] and [minIdle].
3. Configure [maxActive] value higher than [InitialSize] value.
4. Configure [InitialSize] value lower than that of current value.
5. Configure same value with [maxActive], [maxIdle] and [minIdle].
Other Solution)
If it is not...make sure that maxActive value is not 1 and Oracle Toad for client is not running in the background. Provided that the maxActive value is lower than 1, Oracle Toad for client is running and connected to DBMS, it may cause the error because the connection pool already is preempted by Oracle Toad.
Last Solution)
If there is typo in dburl, it is possible to get the error message.

Step1. please check that your Oracle SID, localhost url, and port number of your Oracle DBMS.

Step2. check db url in your jdbc programming code
It may not be solved if there are other reasons. But I hope you can get the idea and guess what is the problem. If you find other way to solve this problem, please share and write comments...
When I ran servlet web application, I got the error message "Got minus one from a read call".
java.sql.SQLException: Got minus one from a read call
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at UserDao.getUser(UserDao.java:27)
at LoginServlet.doPost(LoginServlet.java:30)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
|
Root Cause and Solution)
This one is quite complicated problem. So there are lots of reasons why this error happened. First of all, it is because that connection pool ran over the number of limit.
<Resource name="jdbc/EmployeeDB"
auth="Container"
type="javax.sql.DataSource"
username="dbusername"
password="dbpassword"
driverClassName="org.hsql.jdbcDriver"
url="jdbc:HypersonicSQL:database"
maxActive="8"
maxIdle="4"/>
|
Following is the cases that you can try.
1. Configure [minIdle] value lower than that of current value.
2. Configure same value with [maxActive] and [minIdle].
3. Configure [maxActive] value higher than [InitialSize] value.
4. Configure [InitialSize] value lower than that of current value.
5. Configure same value with [maxActive], [maxIdle] and [minIdle].
Other Solution)
If it is not...make sure that maxActive value is not 1 and Oracle Toad for client is not running in the background. Provided that the maxActive value is lower than 1, Oracle Toad for client is running and connected to DBMS, it may cause the error because the connection pool already is preempted by Oracle Toad.
Last Solution)
If there is typo in dburl, it is possible to get the error message.

Step1. please check that your Oracle SID, localhost url, and port number of your Oracle DBMS.

Step2. check db url in your jdbc programming code
It may not be solved if there are other reasons. But I hope you can get the idea and guess what is the problem. If you find other way to solve this problem, please share and write comments...
Comments
Post a Comment