When i commit it alert "access denied"

Could not read security token from entity com.artwell.sampleordersheet.entity.ColorGroup-2504 [detached], even though there are active attribute access for the entity.
What happened?
i just edit data in datagrid ,and commit this data in ItemPropertyChangeListener

colorGroupsDs.addItemPropertyChangeListener(e -> {
    			if (null == e.getItem().getStyle()) {

i commit it in other entity edit screen,
Is that the problem?


I saw a similar error last week, that turned out to have nothing to do with security.

The record I was trying to save was joined to its parent via a COMPOSITION in the definition. In this case, Cuba will save the record when it’s parent is saved, even if I pressed the Ok button when creating the record on screen. If I then attempted to access the on-screen record again, I got the Access Denied error because it hadn’t been saved. But when I saved the parent record, it was fine, because then Cuba saved the child record at the same time.

I changed the definition to attribute type of the connected record to ASSOCIATION on the parent, so that it could be saved independently, and this solved the problem.

One other thing to bear in mind is that Cuba datasources can only handle compositions that run two levels deep.

thanks ,i konw why,
i set join fetch type EAGER

oh ,That’s wrong,
i set join fetch type as lazy but it also alert Access Denied