Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Saving parition id in the backing store

621488Mar 14 2008 — edited Apr 19 2010
Hi,

We would like to add the partition id into our database backing store.

We would like to do this so that we can re-load only the partion that has been lost if we recieve a PARTITION_LOST PartitionEvent.

The only way that we can see to get thet partition id from a key is to get the KeyPartitioningStrategy from the PartitionedService in our CahceStore.store() method.

Something like this:


void store(Object key, Object value) {

PartitionedService service = (PartitionedService) CacheFactory.getService("distributed-service");

KeyPartitioningStrategy kps = service.getKeyPartitioningStrategy();

int partition = kps.getKeyPartition(key);

jdbc.update("insert into backing_store (key, partition, value) values (?,?,?)", key, partition, value);

}

Is doing this safe? Is there any other way that this could be implemented? Is there a large overhead in calling back to the KeyPartitioningStrategy within CahceStore.store()? (We are using write-through to the backing store so don't want the store() call to be slow.)

Thanks,
Alex
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2010
Added on Mar 14 2008
5 comments
2,229 views