Client/Server Synchronization Problem.

Avatar

Avatar
Level 1
dlacopoFlex
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
dlacopoFlex
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
dlacopoFlex
Level 1

18-09-2009

Hello everyone, I am currently experiencing some problems of Client/Server Synchronisation during the creation of a new entity with Cairngorm.

When I try to create an object, for example "User", I pass a new instance of UserVO with a NULL ID.

COMMAND -> DELEGATE -> REMOTE OBJECT -> SERVER.

My backend is Java & Hibernate.

My UserService successfully adds the new user to my DB.

When I get my object back in my result() function in my COMMAND, the ID of my object that was generated by my DB is never updated in my front end...

Is there a transparent mechanism that can synchronize a new created object with the one returned by my UserService?

Thank you

David

Replies

Avatar

Avatar
Level 1
adrian_aioanei
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
adrian_aioanei
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
adrian_aioanei
Level 1

18-09-2009

The object received from server is an entire new object on the heap. You can keep an user property on the command, reference it to the object received on the CairngormEvent inside the execute method and then when result comes, update id on it from the object received. That is, you need to update properties on objects by hand.