Hello, I don't understand why the type of a relationship field can only be a local component interface. What is if I have relationships between two entity beans with remote component interfaces? I cannot declare in this case cmr fields? How can I have a relation from one bean to another? Please clarify me.
Because you cannot have a foreign key that references a table residing in a remote database. Its as simple as that.
A bean-to-bean relationship (in entity beans) boils down to table-to-table relationship. The cmr fields are fetched using table JOINS. You cannot join two tables that are physically residing on different machines.
hi, As EJB spec there shd not b ani r'ships involving remote enity objs. But some containers like Weblogic allow this.U can establish r'ships b/w remote entity objs but they must b running in same container and, of course, tables repd by the entity neans must b from DB. Here the Weblogic uses pass by reference even tho u r using remote objs
Many thanks for your answer. Keerthi, when the database must be on the same JVM, that means you can have a client on another machine accessing a remote bean and this bean is on the same JVM with my entity bean (the bean is the client for my entity bean).The entity bean accesses the database and has a cmr field to another entity bean. I have right? My problem was that I didn't understand that you can have a client on another JVM. Binoj, it is very interesting that WebLogic can this.
The database need not have to be in the same machine as the entity beans and in most cases it won't. But if two entity beans should relate, the corresponding tables should be in the same database which implies that the beans can only be local to each other.
Bean-A --> Table-A Bean-B --> Table-B
Relating Bean-A and Bean-B using 'remote' interfaces would mean that Table-A and Table-B can also be remote from each other. But the semantic of table joins requires that the related tables are in the same database.
Of course some vendors likee BEA allow relating entity beans using their remote interface but as Binoj mentioned the beans should be in the same machine. [ March 03, 2005: Message edited by: Keerthi P ]