template.setEnableTransactionSupport(true);
template.multi();
template.opsForValue().set("mykey", "Hello World");
List<String> dataList = template.opsForList().range("mylist", 0, -1);
template.exec();
こんにちは、みんな。redis に「mylist」というリストがあり、そのサイズは 50 です。
しかし、このコードを実行すると、必要なものが得られません。
フィールド「dataList」は null ですが、値「Hello World」を持つ「mykey」が私の redis に保持されています。
では、spring-data-redis トランザクションでリスト データを取得するにはどうすればよいでしょうか? どうもありがとう。