-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Can OGM make Mongo session oriented?
PostPosted: Tue Oct 15, 2013 9:31 am 
Newbie

Joined: Fri Aug 29, 2003 8:02 pm
Posts: 8
Does OGM work like Hibernate ORM in that changes are kept in memory until a flush or transaction commit happens? What kind of effect does the JPA Transaction interface have with Mongo?

Thanks

_________________
============
Bill Burke
Chief Architect
JBoss Group, LLC
============


Top
 Profile  
 
 Post subject: Re: Can OGM make Mongo session oriented?
PostPosted: Tue Oct 15, 2013 4:00 pm 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
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

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.