ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamey <cla...@localmatters.com>
Subject Re: Performance with iBatis/DAO/Spring
Date Tue, 28 Nov 2006 16:58:12 GMT
The reason you're not seeing any answers on this topic is because a)
nobody else is seeing the problem (which is saying a lot right there
because the use of Spring and iBATIS together is a very common thing)
and b) you don't send information for which people ask.  The problem you
are trying to track down is not a simple "set no.cpu.hog=true in
ibatis.properties" kind of thing.  Generally, people get help on this
mailing list when they quickly respond with accurate information to
questions from others on the list.  Expecting a silver bullet answer
when your question and followups are vague is unrealistic.

Please send more information about how you are initializing Spring and
iBATIS.  Are you using the Spring SqlMap?  Are you using Spring DAOs or
the iBATIS DAOs?  If Spring, please send along the application context
xml that you are using to init the SqlMap and also a detailed
description of how you are initializing the Spring context.

Also please send actual code your test program is using.  The snippet
below isn't enough to show anything.  How are you initializing the
DaoManager?  What does the getSqlMapExecutor method look like?

Finally, it might help to give more details about the profiling
information you're seeing.  Watching an application slow down in a
debugger is marginally interesting, but numbers from a profiler are
better.

Cheers,
Chris

On Sat, 2006-11-25 at 05:53 +0000, Harish Ram wrote: 
> Hi 
> 
> Let me first apologize for bringing this up again. Unfortunately, I had to since
> I did not see any answers to this thread. And the project is on hold because of
> the performance issue :{  Any help is kindly appreciated.
> 
> I am using Spring/DAO/iBatis for db inserts and am finding this "almost an order
> of magnitude" slower to jdbc.
> 
> I have a single DaoManager for multiple threads and each thread starts with 
> =====
> daoManager.startTransaction();
> getSqlMapExecutor().startBatch();
> getSqlMapExecutor().insert("MyInsertId", mymap);
> daoManager.commitTransaction();
> finally{
> daoManager.endTranasaction();
> }
> =========
> 
> Even when I am debugging, I can clearly see a timed hesitation at
> =========
> 2006-11-24 05:09:06,757 DEBUG [com.ibatis.common.jdbc.SimpleDataSource] Checked
> out connection 13060580 from pool.
> 2006-11-24 05:09:06,836 DEBUG [java.sql.Connection] {conn-114583} Connection
> =========
> And then the insert statment is executed..
> 
> My SqlMapConfig file is as follows
> 
> =======================
>  <settings
>      lazyLoadingEnabled="true"
>      cacheModelsEnabled="true"
>      enhancementEnabled="true"
>      maxRequests="512"
>      maxSessions="128"
>      maxTransactions="32"
>  />
> 
> 
>  <transactionManager type="JDBC">
>    <dataSource type="SIMPLE">
>      <property name="JDBC.Driver" value="com.sybase.jdbc3.jdbc.SybDriver"/>
>      <property name="JDBC.ConnectionURL" value="${url}"/>
>      <property name="JDBC.Username" value="${username}"/>
>      <property name="JDBC.Password" value="${password}"/>
>      <property name="JDBC.DefaultAutoCommit" value="true"/>
>      <property name="Pool.MaximumActiveConnections" value="20"/>
>      <property name="Pool.MaximumIdleConnections" value="10"/>
>      <property name="Pool.MaximumCheckoutTime" value="120000"/>
>      <property name="Pool.TimeToWait" value="500"/>
>      <property name="Pool.PingQuery" value="select * from dual"/>
>      <property name="Pool.PingEnabled" value="false"/>
>      <property name="Pool.PingConnectionsOlderThan" value="1"/>
>      <property name="Pool.PingConnectionsNotUsedFor" value="1"/>
>    </dataSource>
>  </transactionManager>
> ===============================
> QUESTION is, am I missing anything.. Is there anything I can do to speed up the
> transaction. 
> QUESTION, is there anything that I can do to ***reduce time to get connection
> from connection pool ***?
> Any help is kindly appreciated
> 
> sincerely
> Harish
> 

Mime
View raw message