[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Database Connection reset on Oracle 10g AS using Oracle 11g database

Asked by MehtaJasmin in Oracle 11.x Database, Spring, Oracle IAS Application Server

Tags: Oracle 10g AS, Oracle 11g, Spring Framework, iBatis

I have J2EE application running on OC4J application server. Where the database connection is dropping / resetting after some idle time. The idle time varies from 20 mins to 90 mins. The persistence layer is created using Spring and iBatis with Struts as controller.

I am not able to find that why the code / oracle database is trying to close the connection before it makes new one.

Here is the exception log:
[05 Oct 2009 11:55:38] DEBUG [SQLErrorCodesFactory] Looking up default SQLErrorCodes for DataSource [org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@13478c8]
[05 Oct 2009 11:55:38] DEBUG [DataSourceUtils] Fetching JDBC Connection from DataSource
[05 Oct 2009 11:55:38] DEBUG [DataSourceUtils] Fetching JDBC Connection from DataSource
[05 Oct 2009 11:55:38] DEBUG [DataSourceUtils] Returning JDBC Connection to DataSource
[05 Oct 2009 11:55:38] DEBUG [DataSourceUtils] Returning JDBC Connection to DataSource
[05 Oct 2009 11:55:38] DEBUG [SQLErrorCodesFactory] Database product name cached for DataSource [org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy@13478c8]: name is 'Oracle'
[05 Oct 2009 11:55:38] DEBUG [SQLErrorCodesFactory] SQL error codes for 'Oracle' found
[05 Oct 2009 11:55:38] DEBUG [SQLErrorCodeSQLExceptionTranslator] Translating SQLException with SQL state '08006', error code '17002', message [  
--- The error occurred in org/nexweb/qol/gcc/ibatis/dao/xml/User.xml.  
--- The error occurred while applying a parameter map.  
--- Check the getUserByUserNameAndRealmName-InlineParameterMap.  
--- Check the statement (query failed).  
--- Cause: java.sql.SQLException: Io exception: Connection reset by peer: socket write error]; SQL was [] for task [SqlMapClient operation]
[05 Oct 2009 11:55:38] DEBUG [DataSourceUtils] Returning JDBC Connection to DataSource
[05 Oct 2009 11:55:38] DEBUG [UserSqlMapDAO] Could not close JDBC Connection
java.sql.SQLException: Already closed.
      at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:84)
      at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181)
      at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:313)
      at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:166)
      at $Proxy0.close(Unknown Source)
      at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:218)
      at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:271)
      at org.nexweb.qol.gcc.ibatis.dao.sqlmaps.UserSqlMapDAO.getUserByUserNameAndRealmName(UserSqlMapDAO.java:26)
      at org.nexweb.qol.gcc.ibatis.services.UserService.getUserByUserNameAndRealmName(UserService.java:30)
      at org.nexweb.qol.gcc.actions.WelcomeAction.execute(WelcomeAction.java:71)
      at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
      at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
      at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
      at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
      at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
      at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
      at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
      at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:259)
      at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
      at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
      at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
      at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
      at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:392)
      at _jsp._forward._jspService(_forward.java:48)
      at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
      at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
      at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
      at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
      at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
      at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
      at java.lang.Thread.run(Thread.java:595)

Here is the Spring.xml code related to datasource
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
		  "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
    <bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location" value="classpath:jdbc.properties"/>
    </bean>
 
    <bean id="dataSource"
          class=" org.apache.commons.dbcp.BasicDataSource">          
        <property name="driverClassName" value="${jdbc.driverClassName}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>
    </bean> 
   
    <bean id="sqlMapClient"
          class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="configLocation">
            <value>classpath:org/nexweb/qol/gcc/ibatis/config/SqlMapConfig.xml</value>
        </property>
 
        <property name="transactionConfigProperties">
          <props>
                <prop key="autoCommitAllowed">true</prop>
          </props>        
        </property> 
 
       <property name="useTransactionAwareDataSource">
            <value>true</value> 
       </property>
        <property name="transactionConfigClass">
            <value>com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransactionConfig</value>
        </property>
        <property name="dataSource" ref="dataSource"/> 
    </bean>
[+][-]10/05/09 01:41 PM, ID: 25499497Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Oracle 11.x Database, Spring, Oracle IAS Application Server
Tags: Oracle 10g AS, Oracle 11g, Spring Framework, iBatis
Sign Up Now!
Solution Provided By: mrjoltcola
Participating Experts: 2
Solution Grade: A
 
[+][-]10/07/09 03:04 AM, ID: 25513615Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625