[Seasar-user:16643] 再発! Pagerのoffset値がレコード件数より大きい場合にSQLExceptionが発生する問題

寺尾 浩平 [E-MAIL ADDRESS DELETED]
2009年 1月 9日 (金) 18:16:35 JST


$B$*@$OC$K$J$j$^$9!#;{Hx$H?=$7$^$9!#(B

$B0JA00J2<$N7o$G<ALd$7$F$?$b$N$G$9$,(B

DAO-79 
[Seasar-user:6787]Pager$B$N(Boffset$BCM$,%l%3!<%I7o?t$h$jBg$-$$>l9g$K(BSQLException$B$,H/@8$9$k(B

$B>e5-$NLdBj$,(B S2Dao$B$N%P!<%8%g%s(B 1.0.41-RC1
$B$^$G$OIT6q9g$,5/$-$J$+$C$?(B(SqlException$B$K$J$i$J$+$C$?(B)
$B$N$G$9$,!"(B1.0.41-RC1$B0J9_$N%P!<%8%g%s(B
1.0.41$B!A(B1.0.49
$B$G$^$C$?$/F1$88=>]$,:FH/$7!"(B
SqlException$B$,H/@8$7$^$9!#(B

$[E-MAIL ADDRESS DELETED]$9$kJ}K!$O(B
$B$"$j$^$9$G$7$g$&$+!)(B

[$B%G!<%?%Y!<%9(B]
DB2 V9.1.5

[Seasar$B$N%P!<%8%g%s(B]
 s2-extension-2.3.23.jar
 s2-framework-2.3.23.jar
 s2-dao-1.0.47.jar

[dao.dicon]
<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN"
	"http://www.seasar.org/dtd/components21.dtd">
<components namespace="dao">
	<include path="j2ee.dicon"/>
	
	<component
		name="annotationReaderFactory"
		class="org.seasar.dao.impl.FieldAnnotationReaderFactory"/>
	<component
		class="org.seasar.dao.impl.ValueTypeFactoryImpl"/>
<!--
	<component 
		name="stringClobType" 
		class="org.seasar.extension.jdbc.types.StringClobType"/>-->
		
<!--		
	<component 
		name="resultSetFactory"
		class="org.seasar.dao.pager.PagerResultSetFactoryWrapper">
		<arg>
			<component class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/>
		</arg>
		<property name="useScrollCursor">true</property>
	</component>
-->

	<component name="resultSetFactory" class="org.seasar.dao.pager.PagerResultSetFactoryWrapper">
		<arg>
			<component class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/>
		</arg>
		<property name="useScrollCursor">false</property>
	</component>

<!--
	<component 
		name="resultSetFactory"
		class="org.seasar.dao.pager.PagerResultSetFactoryLimitOffsetWrapper">
		<arg>
			<component class="org.seasar.extension.jdbc.impl.BasicResultSetFactory"/>
		</arg>
		<arg>j2ee.dataSource</arg>
	</component>
-->

	<component
		class="org.seasar.dao.impl.DaoMetaDataFactoryImpl">
		<arg>j2ee.dataSource</arg>
		<arg>
			<component class="org.seasar.dao.pager.PagerStatementFactory"/>
		</arg>
<!--
		<arg>
			<component class="org.seasar.extension.jdbc.impl.BasicStatementFactory"/>
		</arg>
-->
		<arg>resultSetFactory</arg>
		<arg>annotationReaderFactory</arg>
	</component>

	<component name="interceptor"
		class="org.seasar.dao.pager.PagerS2DaoInterceptorWrapper">
		<arg>
			<component name="s2dao"
				class="org.seasar.dao.interceptors.S2DaoInterceptor">
			</component>
		</arg>
	</component>

<!--
	<component
		class="org.seasar.dao.impl.DaoMetaDataFactoryImpl"/>
	<component name="interceptor"
		class="org.seasar.dao.interceptors.S2DaoInterceptor"/>
-->
	<component class="org.seasar.dao.impl.BeanMetaDataFactoryImpl"/>
	<component class="org.seasar.dao.impl.DaoNamingConventionImpl"/>
	<component class="org.seasar.dao.impl.BeanEnhancerImpl"/>
	<component class="org.seasar.dao.impl.ResultSetHandlerFactoryImpl"/>
	<component class="org.seasar.dao.impl.DtoMetaDataFactoryImpl"/>
	<component class="org.seasar.dao.impl.PropertyTypeFactoryBuilderImpl"/>
	<component class="org.seasar.dao.impl.RelationPropertyTypeFactoryBuilderImpl"/>
	<component class="org.seasar.dao.impl.DefaultTableNaming"/>
	<component class="org.seasar.dao.impl.DefaultColumnNaming"/>
	<component class="org.seasar.dao.impl.ProcedureMetaDataFactoryImpl"/>
</components>


$B;{Hx!![E-MAIL ADDRESS DELETED]?(B $B$5$s$O=q$-$^$7$?(B:
> $B$*@$OC$K$J$j$^$9!#;{Hx$H?=$7$^$9!#(B
> 
> S2Dao$B$H(BS2Pager$B$rMxMQ$7$F%G!<%?$r(BSELECT$B$9$k:]$K(B
> $B<B:]$N%G!<%?7o?t$h$jBg$-$$%*%U%;%C%HCM$r;XDj$9$k$H(B
> SqlException$B$,%9%m!<$5$l$F$7$^$$$^$9!#(B
> $B$3$N%1!<%9$[E-MAIL ADDRESS DELETED]>o7O$K$9$k$N$,IaDL$J$N$G(B
> S2Dao$B$G(Bnull$B$rJV$9$h$&$K(B
> $B$7$F$$$?$@$1$J$$$G$7$g$&$+!)(B
> 
> $B%(%i!<$,H/@8$9$k%7%J%j%*(B
>    $BA0Ds>r7o(B
>    $B!&2hLL$O8!:w$7$F0lMw$rI=<($9$k2hLL!#(B
>    $B!&0lMw$O(B10$B9TJ,$N%G!<%?I=<(2DG=$G$"$j!"(B
>      10$B9T0J>eD6$($k$H<!%Z!<%8%\%?%s$,I=<($5$l$k!#(B
> 
>    $BA`:n<j=g(B
>    $B-!%f!<%6#A$,8!:w>r7o$rF~$l$F8!:w$9$k!#(B
>        offset:0
>        limit :10
>        $B<B:]$N%G!<%?7o?t(B:11
>    $B-"<!%Z!<%8%\%?%s$,I=<($5$l$k!#(B
>    $B-#%f!<%6#B$,%f!<%6#A$N8!:w$7$?(B11$B7o$N%G!<%?$N$&$A(B2$B7o:o=|$9$k!#(B
>    $B-$%f!<%6#A$,<!%Z!<%8%\%?%s$r2!$9!#(B
>    $B-%(BSQLException$B$,%9%m!<$5$l$k!#(B
>        offset:10
>        limit :10
>        $B<B:]$N%G!<%?7o?t(B:9
> 
> $B!Z(B $B<B9T4D6-(B $B![(B
> Seasar
>    s2-extension-2.3.16.jar
>    s2-framework-2.3.16.jar
>    s2-dao-1.0.40.jar
> 
> DB
>    DB2 V9.1.0
> 
> $B!Z(B Exception$B>pJs(B $B![(B
> 
> *********************************************
> Exception Type$B!'(B com.ibm.db2.jcc.a.SqlException
> Message$B!'(B [ibm][db2][jcc][10120][10898] $BA`:n$,L58z$G$9(B: result set $B$O%/(B 
> $B%m!<%:$5$l$F$$$^$9!#(B
> 
> StackTrace$B!'(B
> *********************************************
> at com.ibm.db2.jcc.a.cg.mb(cg.java:3224)
> at com.ibm.db2.jcc.a.cg.q(cg.java:1261)
> at com.ibm.db2.jcc.a.cg.getMetaData(cg.java:1253)
> at 
> org.seasar.extension.jdbc.impl.ResultSetWrapper.getMetaData(ResultSetWrapper.java:728) 
> 
> at 
> org.seasar.dao.impl.BeanListMetaDataResultSetHandler.handle(BeanListMetaDataResultSetHandler.java:45) 
> 
> at 
> org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler.java:163) 
> 
> at 
> org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler.java:135) 
> 
> at 
> org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler.java:120) 
> 
> at 
> org.seasar.dao.impl.SelectDynamicCommand.execute(SelectDynamicCommand.java:60) 
> 
> at 
> org.seasar.dao.interceptors.S2DaoInterceptor.invoke(S2DaoInterceptor.java:53) 
> 
> at 
> org.seasar.dao.pager.PagerS2DaoInterceptorWrapper.invoke(PagerS2DaoInterceptorWrapper.java:64) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> jp.co.intec.solves4.framework.interceptor.CstmTraceInterceptor.invoke(CstmTraceInterceptor.java:70) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> org.seasar.framework.aop.interceptors.ThrowsInterceptor.invoke(ThrowsInterceptor.java:64) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> org.seasar.framework.aop.interceptors.InterceptorChain.invoke(InterceptorChain.java:42) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.dao.EXZZZExUser001Dao$$EnhancedByS2AOP$$329572$$MethodInvocation$$getUsersOrderDept4.proceed(MethodInvocationClassGenerator.java) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.dao.EXZZZExUser001Dao$$EnhancedByS2AOP$$329572.getUsersOrderDept(EXZZZExUser001Dao$$EnhancedByS2AOP$$329572.java) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.service.impl.EXZZZ001RServiceImpl.getUsersOrderDept(EXZZZ001RServiceImpl.java:57) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.service.impl.EXZZZ001RServiceImpl$$EnhancedByS2AOP$$779b3e.getUsersOrderDept$$invokeSuperMethod$$(EXZZZ001RServiceImpl$$EnhancedByS2AOP$$779b3e.java) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.service.impl.EXZZZ001RServiceImpl$$EnhancedByS2AOP$$779b3e$$MethodInvocation$$getUsersOrderDept1.proceed(MethodInvocationClassGenerator.java) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:45) 
> 
> at 
> org.seasar.framework.aop.interceptors.ThrowsInterceptor.invoke(ThrowsInterceptor.java:64) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> jp.co.intec.solves4.framework.interceptor.CstmTraceInterceptor.invoke(CstmTraceInterceptor.java:70) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> org.seasar.framework.aop.interceptors.InterceptorChain.invoke(InterceptorChain.java:42) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.service.impl.EXZZZ001RServiceImpl$$EnhancedByS2AOP$$779b3e$$MethodInvocation$$getUsersOrderDept1.proceed(MethodInvocationClassGenerator.java) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.service.impl.EXZZZ001RServiceImpl$$EnhancedByS2AOP$$779b3e.getUsersOrderDept(EXZZZ001RServiceImpl$$EnhancedByS2AOP$$779b3e.java) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.action.impl.EXZZZ001RActionImpl.paging(EXZZZ001RActionImpl.java:223) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.action.impl.EXZZZ001RActionImpl.doSearchWithPagerCondition(EXZZZ001RActionImpl.java:207) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.action.impl.EXZZZ001RActionImpl$$EnhancedByS2AOP$$9c1f2c.doSearchWithPagerCondition$$invokeSuperMethod$$(EXZZZ001RActionImpl$$EnhancedByS2AOP$$9c1f2c.java) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.action.impl.EXZZZ001RActionImpl$$EnhancedByS2AOP$$9c1f2c$$MethodInvocation$$doSearchWithPagerCondition3.proceed(MethodInvocationClassGenerator.java) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:45) 
> 
> at 
> org.seasar.extension.tx.RequiredInterceptor.invoke(RequiredInterceptor.java:40) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> jp.co.intec.solves4.framework.interceptor.PageHistoryInterceptor.invoke(PageHistoryInterceptor.java:111) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> jp.co.intec.solves4.framework.interceptor.PDFDownloadInterceptor.invoke(PDFDownloadInterceptor.java:45) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> jp.co.intec.solves4.framework.interceptor.CstmTraceInterceptor.invoke(CstmTraceInterceptor.java:70) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> org.seasar.framework.aop.interceptors.ThrowsInterceptor.invoke(ThrowsInterceptor.java:64) 
> 
> at 
> org.seasar.framework.aop.impl.NestedMethodInvocation.proceed(NestedMethodInvocation.java:43) 
> 
> at 
> org.seasar.framework.aop.interceptors.InterceptorChain.invoke(InterceptorChain.java:42) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.action.impl.EXZZZ001RActionImpl$$EnhancedByS2AOP$$9c1f2c$$MethodInvocation$$doSearchWithPagerCondition3.proceed(MethodInvocationClassGenerator.java) 
> 
> at 
> jp.co.intec.solves4.app.EX.ZZZ.action.impl.EXZZZ001RActionImpl$$EnhancedByS2AOP$$9c1f2c.doSearchWithPagerCondition(EXZZZ001RActionImpl$$EnhancedByS2AOP$$9c1f2c.java) 
> 
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
> 
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:42)
> at 
> org.seasar.framework.beans.impl.BeanDescImpl.invoke(BeanDescImpl.java:190)
> at org.seasar.struts.processor.MethodBinding.invoke(MethodBinding.java:75)
> at org.seasar.struts.processor.MethodBinding.invoke(MethodBinding.java:66)
> at 
> org.seasar.struts.processor.MethodBindingActionCommand.execute(MethodBindingActionCommand.java:40) 
> 
> at 
> org.seasar.struts.processor.ActionExecuteProcessorImpl.processActionExecute(ActionExecuteProcessorImpl.java:48) 
> 
> at 
> org.seasar.struts.processor.S2RequestProcessor.processActionExecute(S2RequestProcessor.java:177) 
> 
> at org.seasar.struts.processor.AcceptorImpl.process(AcceptorImpl.java:128)
> at 
> org.seasar.struts.processor.S2RequestProcessor.process(S2RequestProcessor.java:61) 
> 
> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
> at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) 
> 
> at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) 
> 
> at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) 
> 
> at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) 
> 
> at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) 
> 
> at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) 
> 
> at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) 
> 
> at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> at 
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) 
> 
> at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) 
> 
> at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) 
> 
> at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) 
> 
> at java.lang.Thread.run(Thread.java:595)
> 

-- 
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 ($B3t(B)$B%$%s%F%C%/(B
$B!!@>F|K\CO6hK\It(B
$B!!BhFs%7%9%F%`It(B
$B!!;{Hx!![E-MAIL ADDRESS DELETED]?(B
 $B")(B531-8577$B!!Bg:e;TKL6hK-:j(B5-4-19
 Tel    $B!'(B06-6376-3698
 Fax   $B!'(B 06-6359-2591
$B!!(BeMail $B!'([E-MAIL ADDRESS DELETED]
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ 


Seasar-user メーリングリストの案内