Milos Zikic - Personal site, sharing thoughts about startups, products and engineering

Multiple Data sources and Seam

If You are using multiple data sources with seam there is a big possibility that You will get to the problem of transaction propagation from one data source to another.

With EJB it is easy since You can use REQUIRES_NEW transaction type on methods on other data source but since in Seam this is not present (for the reason I am not aware of) and if going to XA data sources is not an option than there is a simple solution that will work perfectly if You need just to read the data from one data source.

Solution is to use the on the data source You need transactions on and to use for the data source from which You read data.

If You require transactions on both data sources then XA is maybe the only way to go.

Share this post