0

I have started working on a RIAK project via Spring Source. according to their specifications linking between objects and then linkwalking is very simple.

I am saving 2 objects, linking between them and then trying to retrieve the data:

MyPojo p1 = new MyPojo("o1", "m1");
MyPojo p2 = new MyPojo("o2", "m2");

riakManager.set(bucketName1, "k1", p1);
riakManager.set(bucketName2, "k2", p2);

riakManager.link(bucketName2, "k2", bucketName1, "k1", tagName);

System.out.println(riakManager.get(bucketName1, "k1"));
System.out.println(riakManager.linkWalk(bucketName1, "k1", "_"));

the problem is that after the link, the content of the source ("k1") is deleted, only the link stays. This is the printout:

null
[MyPojo [str1=o2, str2=m2, number=200]]

any idea why link operation deletes the value from the source? if I try to set the sources value (again) after the link, then the link gets deleted...

thanks, oved.

Nat Ritmeyer
  • 5,634
  • 8
  • 45
  • 58
o'mac
  • 99
  • 5

2 Answers2

2

Riak requires that the link and the data are stored in one operation. You can't update one without the other (at the moment).

So any time you set the link the operation must also write back the data. I don't know does the Spring adapter take that into account. I did see some messages between the Riak and Spring developers about this, but don't know if anything was fixed yet.

But in any case I am also tending towards using the native Riak Java client rather than Spring.

jodyfanning
  • 1,349
  • 11
  • 7
0

have decided to abandon the spring adapter. it seems it doesn't have good enough support. using the RIAK java client instead. anyone think otherwise?

o'mac
  • 99
  • 5