JDO doesn't have a mechanism to stop queries from overrunning. JPA2 now allows a persistence property to allow timing them out, and most JDO implementations have allowed this as an extension since JDO1. It would make sense for JDO (2.3) to have the same or a variation. Some ideas
Option1 : Simple PMF property "javax.jdo.option.queryTimeout" to specify the number of millisecs (or secs) before any query is timed out. Throw a QueryTimeoutException (extends JDOException) when the timeout happens Option2 : as Option1, plus setTimeout() on Query to define it on a per query basis. Option3 : as Option2, plus we add cancel() on Query so that users can cancel long running queries programmatically, throwing a QueryInterruptedException (extends JDOUserException). The cancel would apply to all currently running invoked queries from that Query instance. I'd go for option 3 since it provides full control in one change and we won't need to revisit the area later to add extra control. Comments ? -- Andy (DataNucleus - http://www.datanucleus.org)