Announcement Announcement Module
Collapse
No announcement yet.
Spring + Websphere connection pooling Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring + Websphere connection pooling

    Following is the entry in my configuration file:

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="java:comp/env/jdbc/springdb"/>
    <property name="lookupOnStartup" value="true"/>
    <property name="cache" value="true"/>
    <property name="proxyInterface" value="javax.sql.DataSource"/>
    </bean>

    I'm using spring jdbc to execute queries. Time taken to execute a simple query is 230 milli seconds.

    I thought it could be a problem with connectivity between the application server and database server. Therefore wrote a sample program by retrieving the Connection from Websphere application datasource (jdbc/springdb) and executed the query. The query execution took only 15 or 32 milli seconds.

    It clearly reveals me that connection is not taken from the connection pool if data source created by JndiObjectFactoryBean.
    I'm using the spring version 2.0.2, Websphere application server 6.1.0.2.

    Please help me in this regard.

    Thanks,
    Khader

  • #2
    If the configured datasource is a connection pool then it is a connection pool regardless if you retrieve it yourself or you let the JndiObjectFactoryBean do it.

    Next to that what are you actually querying and are you sure that you are doing exactly the same! Simply executing a query doesn't take much time, interpreting the results (iterating over the resultset etc) takes a long time.

    Comment


    • #3
      Thanks for the response

      Actually I was using some wrong configurations in the xml file.
      After correcting it, everything works fine.

      Comment

      Working...
      X