0 Replies Latest reply on Jan 14, 2004 5:49 PM by Amit

    Read-Ahead Problem

    Amit Newbie

      Hi PPl,
      I have a cmp which has 2 finder methods, one findByPrimaryKey and other is custom finder which returns collection. For the custom finder method I am using read-ahead with on-find strategy.
      Now the problem is container is throwing sql exception "unexpected end of SQL command" when I try to retreive a value from object returned by findByPrimaryKey method.
      If I call findByPrimaryKey before calling my custom finder method I get no exception but if once I have called custom finder all calls after that to findByPrimaryKey throws same exception. and the query which server is executing is not complete, it says "select id from tablename where "

      If I remove read-ahead from customer finder findByPrimaryKey works fine.

      If I comment this part of jbosscmp-jdbc.xml everything works fine


      <query-method>
      <method-name>findByTransId</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <read-ahead>
      on-find
      <page-size>0</page-size>
      <!--
      Page-Size must be zero. Otherwise order by clause in JBoss-Ql stmt required
      -->
      </read-ahead>


      Enviroment
      jboss-3.0.7_jakarta-tomcat-4.1.24
      Windows XP
      jdk1.3


      Pls advice what's required to fix this issue.