0 Replies Latest reply on Sep 12, 2006 7:56 AM by gemig

    Associations between entity beans under different datasource

    gemig

      Hi!

      I want to partition my application so that the majority of the entity beans are mapped against tables in one (physical) datasource/database, and a few entity beans against another datasource/database. However, I seems to get into trouble when one bean in one 'partition' is associated with a bean in another.

      JBoss gives as message that is unable to deploy one or several beans involved, stating "references an unknown entity" as a cause. I guess this due to the fact that some kind of circular reference, since rearranging the order of persistence-units in persistence.xml doesn't matter.

      This 'design pattern' worked in EJB 2.1. I'm fully aware of disadvantage of the lack of integrity constraints between the databases. However, the goal here is physical data separation of the two 'partitions'.

      I could really need some hints here...

      On a related subject, there is no annotation for specifying a different datasource for a specific entity bean? persistence.xml is the way to go? In the latter case I guess I would have to deploy the entity beans in two different jar-files, unless I want to explictly list all entity beans for each persistence unit...