-
1. Re: Multiple Database - Sanity Check
bungrudi Sep 5, 2009 1:37 PM (in response to bungrudi)After watching this presentation http://www.infoq.com/presentations/native-transactions-java-spring , i'll forget about XA and go with manual compensation instead.
-
2. Re: Multiple Database - Sanity Check
asookazian Sep 7, 2009 10:40 AM (in response to bungrudi)This is an interesting use case. Typically, you must inject an EntityManager interface for each db that is involved in the distributed tx. In your case, the complication is that for a particular user you don't know until runtime which db's will be required to be injected for that specific Seam component.
The Spring video is very interesting and informative. The Spring @Transactional is much more robust than the Seam equivalent. For example, the readOnly attribute set to true (which was available since Spring 2.0), forces Hibernate into MANUAL flush mode, whereby the flush() never occurs and thus the performance hit for comparing object graphs for all cached version and potentially modified version of entity is eliminated. Flushes are essentially suppressed using this attribute.
You can't do this with the Seam @Transactional.
What is manual compensation?
-
3. Re: Multiple Database - Sanity Check
bungrudi Sep 7, 2009 11:33 AM (in response to bungrudi)Manual compensation means manual fix to failed data posting, which if it were in a transaction this will never happen. In the video, he addressed it in around 40th minutes IIRC.