You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 23 Members of 4546 |
| Forum: Seam Users |
13. Aug 2008, 17:02 CET | Link |
I'm looking at porting an existing JSF application over to Seam. My JSF application has 7 data sources it pulls information from using Hibernate. In some instances, it will search 4 of those data sources sequentially for a record, until it finds what it's looking for. The other data sources are legacy databases that we need to pull information from.
My question is, how can I do this in Seam? Currently, I have a lot of hibernate.cfg.xml
files, 2 each (QA and Prod) for each data source. I have a DataContext class that creates a set of SessionFactory objects using the Hibernate configuration files. Since I think Seam is mostly annotation based and not XML base, how can I replicate this functionality?
I believe that you can use your hibernate cfg files as is (though I've never done it myself).. Handling transactions is going to be your biggest problem (imo). you can choose to handle the transactions your self or choose xa-transactions. Search for posts by me, as I've got posts about both.
-Dustin
I was looking at the /resources/META-INF/persistence-dev.xml file and I'm thinking maybe there's a way to work my various data sources into that file and specify them by name to the EntityManager. Is that something that's possible?