File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Query Flush Mode and Persistence Context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Query Flush Mode and Persistence Context" Watch "Query Flush Mode and Persistence Context" New topic

Query Flush Mode and Persistence Context

Mark Garland
Ranch Hand

Joined: Nov 11, 2006
Posts: 226

I'm (still) reading EJB3 In Action.

Page 353 discusses setting the query flush mode. It describes that AUTO is the default, and COMMIT is undefined. Is then says:
In AUTO mode, when queries are executed within a transaction the persistence provider is responsible for making sure that all entities are updated in the persistence context.

Page 379 is discussing performing Bulk Updates and Deletes, and it says
Vendors are only required to execute the update or delete operations, and not required to modify any changes to the managed entities according the specification.
As an example, they suggest how if you deleted an Entity using the query, the associated entity wouldn't be removed from the persistence context.

Strikes me that these two things are contradicting each other - or is there something that I'm not quite getting here?

Any help appreciated.



28/06/06 - SCJP - 69%, 05/06/07 - SCWCD - 92%, 28/02/08 - IBM DB2 v9 Fundamentals (Exam 730) - 87%, 18/11/08 - IBM DB2 v9 DBA (Exam 731) - 89%, 26/02/11 - SCBCD - 88%
I agree. Here's the link:
subject: Query Flush Mode and Persistence Context
It's not a secret anymore!