Hi,
By default the query will be executed on all the available shards. But the database in our application is not in sync.I mean i have table Customer in schema 1 but not in schema 2. Since the query is executed on all the shards it complains the customer table do not exists in shard2.
As per the documentation it just says "The only component of your shard strategy that is consulted when executing a query (Criteria or HQL) is the ShardAccessStrategy. ShardSelectionStrategy is ignored because executing a query doesn't create any new records in the database. ShardResolutionStrategy is ignored because we currently assume that you always want your query executed on all shards. If this isn't the case, the best thing to do is just downcast your Session to a ShardedSession and dig out the shard-specific Sessions you need. Clunky, but it works. We'll come up with a better solution for this in later releases."
I could not understand the above resolution. An example will be more helpful.
please help me to resolve this.
|