[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Associations between entity beans under different datasource

gemig do-not-reply at jboss.com
Tue Sep 12 07:56:45 EDT 2006


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...



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3970979#3970979

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3970979



More information about the jboss-user mailing list