sorry - somehow lost the list in all this...
----- Original Message -----
Sent: Monday, January 07, 2002 3:04 PM
Subject: Re: Can Entity Bean Reference Another Entity Bean using Lookup

maybe if you posted a little more info - specifically the stack trace you get, ejb container you're using, and relevant bits of source code, people could provide a little more feedback.
 
cheers
dim
----- Original Message -----
Sent: Monday, January 07, 2002 2:41 PM
Subject: Re: Can Entity Bean Reference Another Entity Bean using Lookup

The entity bean breed does have a reference to OtherBean for sure.
 
There are 2 senerios :
 
1. Letting Breed Entity bean set it own Type CMR
2. Getting a controller the Session bean to set the Type CMR on the Breed Entity. For example session bean contains (breed.setType(type)
 
 
 
----- Original Message -----
Sent: Monday, January 07, 2002 11:00 AM
Subject: Re: Can Entity Bean Reference Another Entity Bean using Lookup

what is the jndi you are looking up?  is it by any chance "java:comp/env/ejb/OtherEJB" or something similar (the comp/env/ejb bit)?  If so, then what is happening is the session bean has a reference to the other entity bean, but the entity bean does not.  The answer is then in your deployment descriptors.
 
there no doubt could be 10 other answers, but this springs to mind.
 
hth
dim
----- Original Message -----
Sent: Monday, January 07, 2002 1:28 PM
Subject: Can Entity Bean Reference Another Entity Bean using Lookup

Hi all
 
Just wondering :
 
Is it possible for a local entity bean to contain code that lookups another local entity.
 
Setting Description:
 
An entity bean called Breed is must contain entity Type.
I pass a Value Object to the Breed bean. 
The bean :
    obtains the TypeId PK from the VO.
    looks up the JNDI name (errors here, see description below) for the TypeHome
    finds the Type record using the TypeId (PK) via the FindbyPrimaryKey function for the TypeHome.
    sets it type CMR to the found type record
 
Error Description: but an error occurs here while doing the lookup. It says, that the JNDI name cannot be found.
 
However, if I move this to a session bean which does exactly the same. It works. For clarity the session bean:
    accepts the Value Object
    obtains the TypeId PK from the VO.
    looks up the JNDI name  for the TypeHome (works!!!!)
    finds the Type record using the TypeId (PK) via the FindbyPrimaryKey function for the TypeHome.
    sets it type CMR to the found Type record
 
Why???????? Does it work in the session and not entity.
 
TIA
Glenn

Reply via email to