been thinking more on this and since there are no replies I'll share my (possibly) silly thoughts..
Generating native id's should be no problem, but as far as I can see, my problem lies in the ShardSelectionStrategy... How can I make my strategy aware of the shards when the ID of a new object is not yet known at the stage of shard-selection? My thoughts in the previous post was to use a support table (such as the hibernate_unique_key table) residing on the control shard, and then simply keep track of the current highest ID.. but then I would need access to the control session in the ShardSelectionStrategy, right? And I don't really see how I can supply the control session to the strategy since the strategy is defined and supplied to the strategy factory before the actual shard session factory is created...
I might missing something really important and possibly simple here, so please correct me if I'm off here...
Hoping for some good feedback on this:)
Cheers,
Aleksander
|