-->
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.  [ 3 posts ] 
Author Message
 Post subject: ShardAccessStrategy
PostPosted: Tue Aug 19, 2008 5:12 pm 
Newbie

Joined: Wed Feb 20, 2008 10:53 am
Posts: 15
Hello:

I am looking over Shards for the first time and I am confused by a couple things.

1) ShardAccessStrategy. I understand there is sequential and parellel access. If a query returned objects from multiple shards, what does sequential and parallel actually mean? Sequentially querying shards would not bring any results, right? The same with parallel . . . each shard is being queried independently.

2) In the Shards documentation:

http://www.hibernate.org/hib_docs/shards/reference/en/html_single/

in section 3.4, is this example implying that the shardID be stored as an attribute of an entity (Continent)?

3) In section 3.5, if my shards are "production" and "staging" (please don't ask why), my objectIDs won't necessarily be unique. I'll always be querying against one or the other. If the database sequences are identical in both databases, can I just use the normal id generator for sequences in both?

Thank you very much!

Eric


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2008 5:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
1.
sequential means that the query is applied on all shards one after the other.
parallel means that the query is applied on all shards in // and the the result will be consolidated.

2. no it implies that a Continent service can associate a shardID based on the entity id persisted, but that's a business implementation detail, you can chose your own strategy.

3. you cannot use Hibernate Shards if ids for a given entity type are not unique across all shards. So it seems you don't need Shards altogether, just two SessionFactory pointing to staging and production and pick up the right one depending on what you want to do.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: thanks
PostPosted: Thu Aug 21, 2008 8:22 am 
Newbie

Joined: Wed Feb 20, 2008 10:53 am
Posts: 15
thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.