3 Replies Latest reply on May 9, 2004 9:19 AM by sesques

    Ugly query (no joins)

    gorano

      I turned on debug to see the underlying queries, and this is what I
      discovered:

      I have a many to many cmr between groups and roles.
      This is one of the queries used to find the roles via the cmr in the group:

      SELECT NAME, ROLE_GROUP, NOTE FROM SYS_ROLE WHERE
      (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?)
      OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?) OR (NAME=?)

      This is ugly isn't it?? Is there a way to get JBoss to use proper join?
      What will happen if I have 10000 related roles? 10000 OR(NAME=?)s?
      It will crash at some point won't it?

      I guess I am doing something wrong or missing some settings somewhere.

      I am using MySql and JBoss 3.2.3

      /Göran