on 04-05-2007 2:05 AM
We are noticing a database connection problem in our production environment.
We have tried to tune the datasource configuration and nothing seems to help.
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 + sp10
JDK: 1.4.2
Database: Oracle 9i
Dataaccess Layer: Hibernate
O/S: windows server2003
Datasource config:
oracle.thin driver
initial connections 10
max connections 60
We notice that average connection is 15-20
but WAS ofen throw this error
#1.5#00065BF49870004D0000001D000014F000042D526DB51B31#1175731957942#com.sap.engine.services.dbpool#sap.com/tcwddispwda#com.sap.engine.services.dbpool#test2#40##hepcms.hepep.com_CMS_16704750#test2#48035e40e30a11db836800065bf49870#SAPEngine_Application_Thread[impl:3]_30##0#0#Error#1#/System/Audit#Java###Exception #1#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:80)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:396)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:334)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)
at org.hibernate.loader.Loader.doQuery(Loader.java:390)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.hep.tmdm.hib.V_MDMT_DATA.VMdmtDataDAO.findByProperty(VMdmtDataDAO.java:142)
at com.hep.tmdm.mdmt_com_dic_cou.View_V_MDMT_DATA.continueQuery(View_V_MDMT_DATA.java:2544)
at com.hep.tmdm.mdmt_com_dic_cou.wdp.InternalView_V_MDMT_DATA.wdInvokeEventHandler(InternalView_V_MDMT_DATA.java:615)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.clientserver.event.CustomEventProcessor.handleServerEvent(CustomEventProcessor.java:45)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleServiceEvent(WindowPhaseModel.java:361)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:128)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processPhaseLoop(WebDynproWindow.java:345)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:152)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:752)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:705)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:154)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
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(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
#
Hi Frank,
Is this a waining message or the exception? The connection becomes invalid for various reasons. The pool manager should discard the bad connection and create the new connection if necessary.
Two things you can check:
- if the pool manager has the ability to set the following two parameters
connect_time, idle_time
- Check your own code related to preparestatements and result sets. Both of them should be closed properly.
Wish it helps.
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Frank,
thanks for answer!
I'm doing things like you described.
So I think I have somewhere a leak in the application where I loose the session/connection
without closing...
I controlled the code once but it is a bigger application.
So I will do this once again...
regards,
Roland
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Roland
i have resolve this,u can try it like this:
open session
declare transaction
query data using hql
commit transaction
finally:
close session
connect db must using dbpool,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Frank,
I have the same problem you described.
I'm also using Hibernate for persistence in a WDP application.
And from time to time I get this Connection is invalid exception.
I haven't found a solution yet.
How have you solved the problem?
Help is highly appreciated!
Thanx in advance and best regards,
Roland
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks all i got it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks all
jdk version is 1.4.2_11,oracle is 10G ;
i use hibernateV3 as persistence tier
it's pool that WAS provide less parm about datasource, ( i wana cry )
is there an different between hiberate configure:
<property name="dialect">org.hibernate.dialect.SAPDBDialect</property>
&
<property name="dialect">org.hibernate.dialect.Oracleialect</property>
i 've ever us SAPDBDialect &.Oracleialect ,but .Oracleialect & SAPDBDialect often throws this error,
it makeme crazy!!!!,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Frank,
Based on your statement that was often throws this error, which i am intrepreting as being thrown sometimes..indicates that the connection pools are being created but not being released and updated as the stale connections are the reason for having invalid connection handle`s....might want to take a look at the connection pool settings..for that.
Hope that helps
Regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello,
better use higher version of JDK (1.4.9) for 32 bit , then again configure
hope this might help you.
Regards,
chayapathy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.