Hi Bill,
Quote:
Does OGM work like Hibernate ORM in that changes are kept in memory until a flush or transaction commit happens?
Yes, changes are stored on the session level and written to MongoDB upon flush/commit.
Quote:
What kind of effect does the JPA Transaction interface have with Mongo?
Here is what the reference guide says on the topic (http://docs.jboss.org/hibernate/ogm/4.0/reference/en-US/html_single/#_transactions):
"MongoDB does not support transaction. Only changes applied to the same document are done atomically. A change applied to more than one document will not be applied atomically. This problem is slightly mitigated by the fact that Hibernate OGM queues all changes before applying them during flush time. So the window of time used to write to MongoDB is smaller than what you would have done manually.
We recommend that you still use transaction demarcations with Hibernate OGM to trigger the flush operation transparently (on commit). But do not consider rollback as a possibility, this won’t work."
Hth,
--Gunnar