1 Reply Latest reply on Aug 1, 2003 11:30 PM by nraghuram

    N+1 read problem in JBoss CMP?

    vgamerma Newbie


      I don't have JBoss CMP docs handy so I thought somebody know of top off their had.

      If I had the following query in my ejb-jar.xml:
      SELECT OBJECT(d) FROM TableName d
      WHERE d.someField = ?1

      When I do the findBy... that corresponds to that QL I understand it's going to retrieve all the primary keys that match the criteria in one SQL call. Correct?

      Additionally of all of these primary keys are already in the cache it would not need to issues any more loads to the database and so I end up just with one database read. Correct?

      The only reason I am asking is that it takes a bit long to run this method and somebody suggested that JBoss bulk-loading is turned off by default. Is it true?

      Thank you