mybatis run slow ,because the ognl take more time analysis the dynamic xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

mybatis run slow ,because the ognl take more time analysis the dynamic xml

bee87081486@163.com
This post has NOT been accepted by the mailing list yet.
This post was updated on .
mybatis run slow ,because the ognl  take more time analysis the dynamic xml
eg:

update a
<set> 
<if test="a1!= null">a1=#{a1}</if> 
<if test="a2!= null">a2=#{a2}</if> 
<if test="a3!= null">a3=#{a3}</if> 
<if test="a4!= null">a4=#{a4}</if> 
<if test="a5!= null">a5=#{a5}</if> 
<if test="a6!= null">a6=#{a6}</if> 
<if test="a7!= null">a7=#{a7}</if> 
<if test="a8!= null">a8=#{a8}</if> 
<if test="a9!= null">a9=#{a9}</if> 
<if test="a10!= null">a10=#{a10}</if> 
<if test="a11!= null">a11=#{a11}</if> 
<if test="a12!= null">a12=#{a12}</if> 
<if test="a13!= null">a13=#{a13}</if> 
<if test="a14!= null">a14=#{a14}</if> 
<if test="a15!= null">a15=#{a15}</if> 
<if test="a16!= null">a16=#{a16}</if> 
<if test="a17!= null">a17=#{a17}</if> 
<if test="a18!= null">a18=#{a18}</if> 
<if test="a19!= null">a19=#{a19}</if> 
<if test="a20!= null">a20=#{a20}</if> 
<if test="a21!= null">a21=#{a21}</if> 
<if test="a22!= null">a22=#{a22}</if> 
<if test="a23!= null">a23=#{a23}</if> 
<if test="a24!= null">a24=#{a24}</if> 
<if test="a25!= null">a25=#{a25}</if> 
<if test="a26!= null">a26=#{a26}</if> 
<if test="a27!= null">a27=#{a27}</if> 
<if test="a28!= null">a28=#{a28}</if> 
<if test="a29!= null">a29=#{a29}</if> 
<if test="a30!= null">a30=#{a30}</if> 
</set> 
 

mybatis take more seconds to analysis the dynamic xml ,

ibatis2 can take less seconds to analysis the dynamic xml ,

update a
    <dynamic prepend="set"> 
    <isNotNull property="a1" prepend=",">a1 = #a1#</isNotNull> 
    <isNotNull property="a2" prepend=",">a2 = #a2#</isNotNull> 
    <isNotNull property="a3" prepend=",">a3 = #a3#</isNotNull> 
    <isNotNull property="a4" prepend=",">a4 = #a4#</isNotNull> 
    <isNotNull property="a5" prepend=",">a5 = #a5#</isNotNull> 
    <isNotNull property="a6" prepend=",">a6 = #a6#</isNotNull> 
    <isNotNull property="a7" prepend=",">a7 = #a7#</isNotNull> 
    <isNotNull property="a8" prepend=",">a8 = #a8#</isNotNull> 
    <isNotNull property="a9" prepend=",">a9 = #a9#</isNotNull> 
    <isNotNull property="a10" prepend=",">a10 = #a10#</isNotNull> 
    <isNotNull property="a11" prepend=",">a11 = #a11#</isNotNull> 
    <isNotNull property="a12" prepend=",">a12 = #a12#</isNotNull> 
    <isNotNull property="a13" prepend=",">a13 = #a13#</isNotNull> 
    <isNotNull property="a14" prepend=",">a14 = #a14#</isNotNull> 
    <isNotNull property="a15" prepend=",">a15 = #a15#</isNotNull> 
    <isNotNull property="a16" prepend=",">a16 = #a16#</isNotNull> 
    <isNotNull property="a17" prepend=",">a17 = #a17#</isNotNull> 
    <isNotNull property="a18" prepend=",">a18 = #a18#</isNotNull> 
    <isNotNull property="a19" prepend=",">a19 = #a19#</isNotNull> 
    <isNotNull property="a20" prepend=",">a20 = #a20#</isNotNull> 
    <isNotNull property="a21" prepend=",">a21 = #a21#</isNotNull> 
    <isNotNull property="a22" prepend=",">a22 = #a22#</isNotNull> 
    <isNotNull property="a23" prepend=",">a23 = #a23#</isNotNull> 
    <isNotNull property="a24" prepend=",">a24 = #a24#</isNotNull> 
    <isNotNull property="a25" prepend=",">a25 = #a25#</isNotNull> 
    <isNotNull property="a26" prepend=",">a26 = #a26#</isNotNull> 
    <isNotNull property="a27" prepend=",">a27 = #a27#</isNotNull> 
    <isNotNull property="a28" prepend=",">a28 = #a28#</isNotNull> 
    <isNotNull property="a29" prepend=",">a29 = #a29#</isNotNull> 
    <isNotNull property="a30" prepend=",">a30 = #a30#</isNotNull> 
  </dynamic> 


ognl is bad practice to analysis the dynamic xml