Eclipse Community Forums - RDF feed Eclipse Community Forums
Does flush() sync with the db or the L2 cache? demonstrating the
limitations of my understanding of the JPA/EclipseLink caching
mechanism. I am using Glassfish 3.1, Eclipse Persistence
Services - 2.2.0.v20110202-r8913 and MySQL 5.1.50, container
managed transaction scoped entity manager.  My timer routine
does this:  - named query on a table to get list of unprocessed
events     - for each unprocessed event returned by the query:
- process the event         - set the processed state flag to
processed         - flush() - end  Because the timer process is
running in a transaction I simply call the setter to change the
processed flag, without calling EntityManager.merge(), it's a
managed entity after all. I would expect the change to commit
following return from the timer routine, and implicitly, the end
of the transaction.  Where I'm querying and modifying the
'processed' flag from within the persistence context all is ok,
but for testing purp