3 Replies Latest reply on Oct 21, 2002 2:09 PM by Andrew Perepelytsya

    ejb-ql "IS NOT EMPTY"

    Andrew Perepelytsya Newbie

      Hi.

      it's a bidirectional many-to-many relationship. in pointbase 4.2 DB it's implemented with the help of association table (2 foreign keys, both columns are NOT nullable, no primary key).

      so, any other possible realtionship is working. i try to navigate from both sides. from one side it's working 100% perfectly. from the other the following query IS working:

      SELECT DISTINCT OBJECT(s) FROM Stock AS s WHERE s.users IS EMPTY

      (it's not what I need)

      but this one (which is required by the logic of an application) is not getting through (runtime error, but the deployment is ok):

      SELECT DISTINCT OBJECT(s) FROM Stock AS s WHERE s.users IS NOT EMPTY

      the exception trace is:

      13:28:08,526 ERROR [STDERR] javax.ejb.FinderException: Find failed: java.sql.SQLException: Missing relational operator at position 115.

      I couldn't turn on sql logging in JBoss, no matter what i tried after diggin' all forums. If you can give me the *exact* category to set the log priority on, I'd be much better off. The database log DOESN'T show the sql requested, but only the error code "10009 missing relational operator". I found this code in both Pointbase and Oracle 8i DBs docs.

      I tried a manual query from DB console as follows:

      select distinct fk_stock_id from link_users_stocks where fk_user_id is not null

      my understanding is that this should be smth close to the query JBoss generates. This query works fine, returning null (there's 1 user and no stocks registered yet, so both STOCKS and LINK_USERS_STOCKS tables are empty). AFAIK, the container translates this null value into an empty collection.

      so far, very odd behaviour, i must say :(

      JBoss 3.0.3, Pointbase 4.2, JDK 1.4.0-b092, WIN XP Pro

      Any input is appreciated, for this problem really makes everybody nervous

        • 1. Re: ejb-ql "IS NOT EMPTY"
          Andrew Perepelytsya Newbie

          ran into even bigger problem. i tried to rearchitect the application a little, so the finder goes from user to stock now, but --- yeah --- THE SAME problem. everything works ok, if i put IS EMPTY in the query, and the same exception, if i put IS NOT EMPTY.

          seems to me that IS NOT EMPTY is not implemented in JBoss?!

          i would be happy to be wrong, but no replies so far.

          • 2. Re: ejb-ql "IS NOT EMPTY"
            Andrew Perepelytsya Newbie

            ran into even bigger problem. i tried to rearchitect the application a little, so the finder goes from user to stock now, but --- yeah --- THE SAME problem. everything works ok, if i put IS EMPTY in the query, and the same exception, if i put IS NOT EMPTY.

            seems to me that IS NOT EMPTY is not implemented in JBoss?!

            i would be happy to be wrong, but no replies so far.

            • 3. Re: ejb-ql "IS NOT EMPTY"
              Andrew Perepelytsya Newbie

              ran into an even bigger problem. i tried to rearchitect the application a little, so the finder goes from user to stock now, but --- yeah --- THE SAME problem. everything works ok, if i put IS EMPTY in the query, and the same exception, if i put IS NOT EMPTY.

              seems to me that IS NOT EMPTY is not implemented in JBoss?!

              i would be happy to be wrong, but no replies so far.