FlushMode.AUTO flushes changes (creates, updates, deletes) to the database upon a query being applied or an explicit flush or a commit of the transaction, correct?
What counts as a query being applied? Is it just an EJB-QL query or would an EntityManager.find(anEntity) count as well?
What other things count as queries apart from the 1 (or 2) things above?
Also, do queries flush changes only for those changes to the object instances mentioned in the query itself, or does it flush all unflushed changes for that EntityManager?