cancel
Showing results for 
Search instead for 
Did you mean: 

BaseSQLException: Connection is invalid

Former Member
0 Kudos

We are noticing a database connection problem in our production environment.

We have tried to tune the datasource configuration and nothing seems to help.

Below is the exception trace pointing to SAP Web AS 6.40 throwing invalid

connection exceptions. The application breaks consistently running different queries

with the below exception.

Can some one please help me understand the exception. Any suggestions to fix this problem?

Thanks

Server: SAP Web AS 6.40

JDK: 1.4.2

Database: Oracle 9i

Dataaccess Layer: SpringFramework - http://www.springframework.org

O/S: Linux

[code]

2006-02-22 11:17:14,840 INFO [com.app.dataaccess.dao.ProdDAO] - <[findByID] entering>

2006-02-22 11:17:14,851 INFO [com.app.dataaccess.dao.ProdDAO] - <[XXXX] Exception > executing PreparedStatementCallback: encountered SQLException [Connection is invalid.]; nested exception is com.sap.engine.services.dbpool.exceptions.BaseSQLException: Connection is invalid.>

Caused by: org.springframework.jdbc.UncategorizedSQLException: executing PreparedStatementCallback: encountered SQLException [Connection is invalid.]; nested exception is com.sap.engine.services.dbpool.exceptions.BaseSQLException: Connection is invalid.

com.sap.engine.services.dbpool.exceptions.BaseSQLException: Connection is invalid.

at com.sap.engine.services.dbpool.cci.ConnectionHandle.checkIfInvalid(ConnectionHandle.java:501)

at com.sap.engine.services.dbpool.cci.ConnectionHandle.checkIfValid(ConnectionHandle.java:487)

at com.sap.engine.services.dbpool.cci.ConnectionHandle.prepareStatement(ConnectionHandle.java:89)

at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:216)

at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:444)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:491)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:522)

at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:543)

at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:114)

at org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:124)

at com.app.dataaccess.dao.ProdDAO.findByID(Unknown Source)

at sun.reflect.GeneratedMethodAccessor351.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)

at java.lang.reflect.Method.invoke(Method.java:391)

at sun.reflect.GeneratedMethodAccessor301.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)

at java.lang.reflect.Method.invoke(Method.java:391)

at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(AccessController.java:180)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)

[/code]

Datasource config:

oracle.jdbc.pool.OracleDataSourceFactory

oracle.jdbc.pool.OracleConnectionPoolDataSource

Accepted Solutions (0)

Answers (1)

Answers (1)

kishorg
Advisor
Advisor
0 Kudos

Hi Ray,

from where u got this Exceptions , is it from the Visual Admin(during data source creation time using Oracle 9i) or from the application where ur particular code for executing the SQL statement ?.

or

getting this exception while starting the server itself ?.

r u using Oracle 9i in ur server (selected during installation)?.

if it is from Application,

could u successfully connect to the server while cheching from the Visual Administrator?.

let me know.

Regards

Kishor Gopinathan

Former Member
0 Kudos

These exceptions are thrown when the web application is querying the database, simple queries are failing with the dbconnection invalid error.

In VAdmin I can connect to Oracle 9i and run a test query fine. But the application intermittently breaks down with dbconnection invalid error and hence no data gets returned from Oracle.