Jboss As 4.0.3SP1
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?
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