I'm working on a GWT 2.5.1 + Spring 3.2 + Hibernate 4 project. The Spring-Hibernate application is already working and has the usual Service/Dao layers. Transactions are handled by Spring through @Transactional annotations on service methods.
I'm trying to add the GWT layer on top of it using GWT RequestFactory. In particular, I don't understand how RequestFactory and Spring-managed transactions should work together.
It seems like RequestFactory performs a lot of queries (see find/getId methods of Locator class) before and after actually calling the requested service method. BTW: Should Locator rely on a Spring service bean to perform those queries? I guess so.
This means RequestFactory do things in different transactions, which is bad. I want the whole request to happen in the same transaction to take advantage of Hibernate cache (well, this is just the main reason).
I think @Transactional annotations should somehow be moved up to the GWT server layer, but they must be on a Spring bean in order to work, so...
What's the best way to integrate GWT RequestFactory and Spring-managed transactions?