This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

GWT issue with entity relationships

Feb 17th, 2011, 02:04 AM

To understand clearly the issue, here is the failing use case with the Expenses.roo sample :
- Create a new Employee
- Create a new Report with selecting the previously created employee as reporter
- Edit the Report and doesnt modify anything
- Click on Cancel or on another menu entry => A confirmation dialogbox appears with "Are you sure you want to abandon your changes?"

Roo relies on the RequestContext.isChanged method that returns TRUE whereas no change has been done.

When digging a little bit more, the AutobeanUtils.diff(x,y) detects a change on the field 'reporter', the equality being delegated to EntityProxyCategory.equals. 2 entityProxy are considered equals if they have the same stableId (normal!) and hosted by the same requestContext.

For our issue, the stableId are the same but the requestContext are not the same, as the old entityProxy has a requestContext = NULL (!) whereas the new one has a requestContext not null.

I dont know if this a Roo pb of requestContext handling or a GWT pb, but anyway the GWT support of Roo is not complete and not usable for a production env.

It is troubling that the header to the roo documentation has a big caption about GWT integration. I spent hours trying to figure out why 1.1.0 has so many issues and then discovering 1.1.1 just doesn't work. It was a waste of time trying the expenses sample directly from GWT SDK samples directory too, then deleting the maven repositories, etc...

It is a big red flag regarding the direction of roo... more big marketing and empty promises form yet another Java web framework. It it most troubling because this is one of the first common sense java web approaches that can compete with other language tools. It is almost light weight enough to encourage shared hosting companies to start offering a Java option again.

Comment

I'd agree that a lot of the GWT support up to this point has been flaky. That said, the progression from 1.0 --> 1.1.1 --> 1.1.2 (ish) does show a lot of progress. Making no apologies obviously, but I think the synergy between GWT and Roo caught both groups off guard, and they are now working to align their priorities.

I'm currently working with a build of Roo straight from the source, and have managed some decent progress in a short amount of time on a product. You're right: it's not ready for production, enterprise-level apps, but it is moving in the right direction. I, for one, will be happy when I never have to remember the idiosyncrasies of one persistence framework over another!