1 Reply Latest reply on Nov 7, 2005 1:15 PM by dunks80

    Long running query

    dunks80

      Jboss As 4.0.3SP1
      jdk 1.5.0_04

      Does anyone have any best practices for using the entity manager for really long running queries? I have a sort of batch job that runs by iteself every night and basically queries for every record in this one table and then needs to process through all the results The query is causing ejb transaction timesouts because it's so long even with the relationships all as Fetch.LAZY. What would be the best way for me to handle this? Only pulling back a certain number of results per method call and then paging through the entire table?

        • 1. Re: Long running query
          dunks80

          I ended up just querying the table for 100 results at a time unitl I had queried all records and that seemed to work. If anyone has any better ideas please let me know. Thanks