Changed entity ignored. meta_dirty not changes to true.

22 views
Skip to first unread message

Александр Шелюгов

unread,
Mar 25, 2015, 5:35:21 AM3/25/15
to gran...@googlegroups.com
Greetings, I have a problem. I load an entity instance from the server and changing boolean field in it to the opposite value. I would like to avoid sharing source code.

Originally, [Managed] metadata tag has been added only for the subclass, generated  Gas3 v2.3.0. I tried to add [Managed] metadata tag to the entity class itself, but it didn't help.

When I try to save this modified entity, then:
1. meta_dirty is equal to false
2. Server receives cached entity, with old value of this boolean field.

When I creating a new entity instance, before saving, I assign new UID to it programmatically. See https://groups.google.com/forum/#!searchin/graniteds/article/graniteds/Ze-RPR-ItBo/U7nex_Ze6RoJ and replies.

Did anyone face the same issue? How to make meta_dirty flag equal to true? How to update an entity in cache?

Or, speaking more generally, how to send exactly this modified entity instance to the server? Without using DTO's.

Thank you for your attention.

Александр Шелюгов

unread,
Mar 25, 2015, 5:36:36 AM3/25/15
to gran...@googlegroups.com
Server uses Spring framework.

среда, 25 марта 2015 г., 12:35:21 UTC+3 пользователь Александр Шелюгов написал:

Александр Шелюгов

unread,
Mar 25, 2015, 8:05:47 AM3/25/15
to gran...@googlegroups.com
Update: problem seems to be not because of meta_dirty value. I've tried different use case and latter is working.

If I save loaded entity with changed flag right away, then modified entity arrives at the server.
If I save loaded entity by usual "save" first, and then save it with changed boolean flag - server receives cached version.

If I'm not wrong, meta_dirty were false in both cases. Even, Tide.getInstance().getContext.meta_deepDirty(myEntity) is false in both cases.

Александр Шелюгов

unread,
Mar 25, 2015, 10:01:22 AM3/25/15
to gran...@googlegroups.com
It seems to be solved, but it's probably not proper solution. After every save work rewrite "myEntity" with e.result, where e is TideResultEvent. After first save, they are different instances of the same entity instance ((myEntity == e.result) is false).
Reply all
Reply to author
Forward
0 new messages