2 Replies Latest reply on Mar 12, 2004 12:42 PM by mkyaj

    Verifying the read-ahead methods

    mkyaj Newbie


      I am using JBOSS3.2.2 and postgreSQL7.3.1 as database.

      I believe if i dont use any read ahead method then the findAll() method will suffer from n+1 problem. Means if i have n records for an EntityA.
      So when i call findAll() which returns EntityA, JBOSS will only read the Primary keys of all the records. When we access any business method on the entity it will load the total entity.

      When i use on-find strategy it will load all the entities in single query. But how can i verify that? How can i check how many queries have been fired? Can i do that using triggers in database means incrementing some field whenever there is a SELECT? But i read somewhere that SELECT cannot fire any triggers.

      Please suggest me some way to verify that.