-->
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.  [ 6 posts ] 
Author Message
 Post subject: MongoDB Read Preferences & WriteConcerns support
PostPosted: Fri Jan 17, 2014 2:53 am 
Newbie

Joined: Thu Jan 16, 2014 6:30 pm
Posts: 3
1. I was trying for the options to see an option to set ReadPrefernce in OGM . However I didn't see an option to set the ReadPrefernces. Is this property available? If it is not available can information be provided as the when this will be available?
(Note: For write concern I could see the documentation on hibernate.ogm.mongodb.writeconcern)

2. Natively MongoDB allows setting the ReadPreferences and Write Concerns per request. In Hibernate OGM I saw only an option to set this while configuring the MongoDB settings. I don't expect it to be changed frequently, however some parts of our app may potentially use a different read preference/ write concerns. Is there a way to change this dynamically per request without affecting the whole configuration?


Top
 Profile  
 
 Post subject: Re: MongoDB Read Preferences & WriteConcerns support
PostPosted: Fri Jan 17, 2014 7:55 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
1) It is not possible at the moment to set the property. I've opened a JIRA for it: https://hibernate.atlassian.net/browse/OGM-420
(It is not so hard to solve it if you want to give it a go)

2) We are working on improving the options mechanism to set options but at the moment it is not possible to do what you are asking.
In the meanwhile you can try to create your own dialect copying the MongoDBDialect class and setting the properties you need when the updateTuple or updateAssociation methods are called.

Hope this help,
Davide


Top
 Profile  
 
 Post subject: Re: MongoDB Read Preferences & WriteConcerns support
PostPosted: Fri Jan 17, 2014 8:12 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
I created a new JIRA for setting the properties per request: https://hibernate.atlassian.net/browse/OGM-421


Top
 Profile  
 
 Post subject: Re: MongoDB Read Preferences & WriteConcerns support
PostPosted: Sun Jan 19, 2014 9:53 pm 
Newbie

Joined: Thu Jan 16, 2014 6:30 pm
Posts: 3
Thank you very much for the quick response with precise details to what I was looking it. I will look into the possibility of engaging in this and trying out the workaround you proposed.

It was great to see that it was in Jira already . I know it may be hard to provide details on when this would be worked on, but is it possible to get a ballpark, based on the current priority queue when is it realistic to expect someone to start working on this?


Top
 Profile  
 
 Post subject: Re: MongoDB Read Preferences & WriteConcerns support
PostPosted: Mon Jan 20, 2014 10:23 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

Quote:
Is there a way to change this dynamically per request without affecting the whole configuration?


Just to be sure, your case would be addressed by making it possible to set these properties to specific values per session, right? There will be support for this at some time (see https://hibernate.atlassian.net/browse/OGM-343).

Quote:
[...] is it possible to get a ballpark, based on the current priority queue when is it realistic to expect someone to start working on this?


You basically can get started with implementing this whenever you like ;-)

Kidding aside, it would be awesome to get help on this and I believe this issue makes a good starter to dive a bit deeper into OGM. The basic infrastructure for the property mechanism is in place and if you decide to give it a try, I can help you with getting started and letting you know where to have a closer look.

--Gunnar

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


Top
 Profile  
 
 Post subject: Re: MongoDB Read Preferences & WriteConcerns support
PostPosted: Wed Jan 22, 2014 1:52 am 
Newbie

Joined: Thu Jan 16, 2014 6:30 pm
Posts: 3
Thanks for the reply. Missed replying to the question earlier. Yes, the session level setting mentioned in https://hibernate.atlassian.net/browse/OGM-343 is what I was looking for.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.