Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.0.0-M2
-
None
-
None
Description
It's hard for me to reproduce, but wanted to post a bug, to slowly build any evidence we can find to fix this bug.
I used to do lots of em.getReference (because I got confused, and used that instead fo em.find). In non-slice code, it worked perfectly fine. But when I used slices, it would fail, but not in a very predictable/reproducable manner. let me try to explain. Here is some code that failed for me:
Team team = em.getReference( teamId );
String name = team.getFullName();
I would get a reference to the Team object. And even at the next line, when I tried to access a field from that object, it would throw an exception, complaining that the object did not exist any longer. For some reason it did not find the object. So I tried this:
Team team = em.getReference( teamId );
log().debug( "SLICE: "+SlicePersistence.getSlice( team ) );
String name = team.getFullName();
And it said "SLICE: null". So my only clue is that the slice was not set properly for references, so that they might fail in a later time..