Announcement Announcement Module
No announcement yet.
Spring JDBC with Websphere 7 not closing connections Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring JDBC with Websphere 7 not closing connections


    It would be great if anybody could help in figuring out the DB connection issue that I have been facing. I looked into the tool for Websphere 7.0 and saw that the number of open connections keeps on increasing.

    The error is: Could not get JDBC Connection; nested exception is tion:

    I am using Jdbc templete hence not closing the connections expliciltly.

    Below is the Context.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""
    xmlns:xsi="" xmlns=""
    xmlns:jee="" xmlns:tx=""
    <jee:jndi-lookup id=" dataSource " jndi-name="jdbc/DS"
    cache="true" resource-ref="true" lookup-on-startup="true"
    proxy-interface="javax.sql.DataSource" />

    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" >
    <property name="dataSource" >
    <ref bean="dataSource"></ref>

    <bean id="messageSource" class= " eMessageSource">
    <property name="basenames">

    <bean id="Impl" class="Impl" >
    <property name="jdbcTemplate" >
    <ref bean="jdbcTemplate"></ref>
    <property name="messages" ref="messageSource"/>

    <bean id="DAO" class="org.springframework.aop.framework.ProxyFact oryBean">
    <property name="proxyInterfaces">
    <property name="target">
    <ref bean="Impl"/>


    Can anybody please help me with this !!!!!!


  • #2
    Use [ code][/code ] tags when posting code ...

    You aren't managing transactions and thus not managing resources (connections), to have proper resource management proper transaction setup is required. I suggest a read of the tx chapter of the reference guide.


    • #3
      Thanks for the reply.

      A small query : The code works in WAS 6.1 and its giving proble in WAS 7.0.

      Can you please highlight me on this ?



      • #4
        It still has to do with proper resource management, the fact that it works in WAS6.1 is more of a coincidence then it not working in WAS7, but that is imho of course. Could be the connections time out faster in WAS6.1, could be that it is much slower which leaves more time for connection time outs.. .Etc...

        The fact is still you don't have proper resource management (transactions) configured.


        • #5
          Thanks again.

          Ill will look into this.

          CAn you please clarify another query.

          I am using jdbcTemplate. Will it not take care of opening and closing the connection itself ?