Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2222

LiveObjectService#persist returns empty object

$
0
0

I'm using the Redisson Live Objects 3.13.2 and I have the following object:

@Getter@ToString@Builder@AllArgsConstructor@NoArgsConstructor@REntitypublic class ReporterObject {    @RId    private long id;    private long rId;    @RIndex    @Setter    private long sId;    @Setter    private boolean ac;    @RIndex    @Setter    private Long parId;    private int type;    private Long pId;    @Setter    private ReporterObject parent; // can be null    @Setter    private int n_a = 0;}

So I have two problems:

  1. When I this operation(to override the current object):
liveObjectService.delete(ReporterObject.class, reporterObject.getRId());return liveObjectService.persist(reporterObject);

I sometimes get java.lang.IllegalArgumentException: This REntity already exists. although I'm performing a deletion beforehand. I can get it even if the cache is totally empty before then.

  1. Sometimes after the persist operation supposedly succeed, what I receive is an empty object so when I try to get any field(for example call ReporterObject#getParent a NullPointerException is being thrown and when I debug it, I see an empty object or not "fully full" object:enter image description here. In this example I only have sId and type but no id , no rId, no ac etc. As I stated, If I try to getAc() a NullPointerException is thrown. Of course it's not limited to this fields only. Sometimes it's other fields that are missing. Sometimes I get a fully empty object like this one:enter image description here

Any ideas on what to do in this case?

Thanks!


Viewing all articles
Browse latest Browse all 2222

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>