I can change entities on server without persisting because the servers job is just to perform modification based on some onEventListener in comboBox that needs to perform a business validation rule, then entity is sent back to client. While the user is on the form the client might very well make multiple request to server to perform modifications before actually persisting the newly modified entity. I guess this kind of flow was driven by the need to just pass a final entity to the server and just persist it rather than do all the validation and updates at the very end of the process.
Another approach I thought about doing was don't pass actual Hibernate entities to the server but pass DTOs instead for modification. And then return these data objects back to the client, I can then update the user context entity on client from these DTOs. This will give me the ability to perform business logic on server without the granite magic, but will add the cost of transferring data back and forth between DTOs.
The suggestion you gave was to call the server in a spring context. But I'm not familiar with APIs you are using. Is there a Spring.java class I don't know about Spring.getInstance().getContext(). Is this the SpringContextManager?
Also I make calls to server through the granite generated service code like the following. I dont see where you can pass a context, or maybe I need to use a completely different API to make server calls.
public Future<List<BlotterView>> getDeals(List<Search> arg0, TideResponder<List<BlotterView>> tideResponder) {
return super.call("getDeals", arg0, tideResponder);