1 Reply Latest reply on Oct 17, 2002 3:15 AM by Alexey Loubyansky

    Finder SQL Code not getting updated

    Jeremy Cowgar Newbie

      I am having a problem currently with JBoss. I noticed when I Went back to change a SQL clause that it is not updating in JBoss. I built my system from the template sample and use Ant 1.5.1, xdocklet, and JBoss 3.0.3.

      Here is what the revelate portion of code (for xdoclet) looks like:

      * @ejb:finder signature="java.util.Collection findByName(java.lang.String firstName,java.lang.String lastName)"
      * @jboss:finder-query name="findByName"
      * query="patFirstName = {0} AND patLastName = {1}"

      The * are new lines, the rest of the line feeds is wordwrapping.

      Anyway, I run ant, check my build/deploy/my.jar /meta-inf/jaws.xml and my query is correct, exactly what I want it to be.

      I then checked the one in c:\jboss-3.0.3\server\default\deploy\my.jar and it too is ok. I then stoped jboss, deleted c:\jboss-3.0.3\server\default\tmp and restarted thinking maybe something got stuck in cache or something. Still executes the old and wrong query (oh I am looking at the mysql.log file to see the query in it's end result as JBoss is sending it to mysql).

      I then decided to check in the tmp\deploy\my.jar\ directory and in their is now 1 file (because I just cleared it before last start). I unjard that, and it too is good.

      For the fun of it, I changed my query code to read something that would fail totally (other one just searches by firstName instead of firstName and lastName. I changed it to be:

      this_field_does_not_exist = {102930291023} AND this will really screw it up, I know '''```''' for sure = {-304930.2029302} ORDER BY 923094839*(#@*#(@*(*$&@(

      I ran ant again, restarted jboss. When it still issued the old firstName = {0} query, I was blown away and verified again in all the same spots that the jaws.xml file was correct (or in this case incorrect) and it was!

      What can be going on?

      Any help would be greatly appriciated.

      Jeremy Cowgar

        • 1. Re: Finder SQL Code not getting updated
          Alexey Loubyansky Master

          Isn't it cool? :) JBoss can execute a query like "this_field_does_not_exist = {102930291023} AND this will really screw it up, I know '''```''' for sure = {-304930.2029302} ORDER BY 923094839*(#@*#(@*(*$&@("

          What JBoss version are you using? Are you sure you use JAWS? I guess, JBossCMP is used instead and the old query is in jbosscmp-jdbc.xml.
          To customize the query in jbosscmp-jdbc.xml @jboss.query is used.