> "danch (Dan Christopherson)" <[EMAIL PROTECTED]> wrote:
 
> [EMAIL PROTECTED] wrote:
> 
> > 
> > I'm new to EJB, so my understanding of what's happening in 
> finders is
> > limited. The finders look like they only find stuff that 
> has been saved to
> > the database. Is it possible to have created beans that are 
> "unfindable"?
> 
> 
> Finders only find stuff that has been saved to the database. 
> Usually this 
> 
> kind of problem is seen with updates, not creates, though. 
> Creates are pushed 
> 
> into the database immediately, whereas updates are deferred 
> until the end
> 
> of the transaction. Bill Burke recently implemented a feature that 
> causes updates for a bean to be flushed before a finder is called for
> that bean.

Actually, I seem to be having a much more interesting problem. The objects
that I have references to seem to be moving about. In my entity beans, I'm
caching the references to the other entities I'm associated with, along the
lines of:

  public int locationUID;
  private Location location;

  public Location getLocation() throws RemoteException {
    if (this.location == null && this.locationUID > 0)
      this.location = this.findLocation(this.locationUID);
    // Check for a container playing silly buggers
    if (this.location != null && this.location.getUID() != this.locationUID)
{
      System.err.println(this.getClass().getName() + " " + this.getUID() + "
Clashing UIDs in location wanted " + this.locationUID + " got " +
this.location.getUID());
      throw new RemoteException(this.getClass().getName() + " " +
this.getUID() + " Clashing UIDs in location wanted " + this.locationUID + "
got " + this.location.getUID());
    }
    return this.location;
  }

After a while, I get in the log:

[TestNode] Activated bean TestNode with id =
au.csiro.cmis.jms.config.ConfigPK=20739
[TestNode] au.csiro.cmis.jms.config.TestNodeBean 20739 Clashing UIDs in
location wanted 50 got 51

Is a dirty instance of TestNodeBean re-used from a pool when the bean is
activated. Should I be nulling the location cache on
activation/passivation/somewhere?


 

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to