> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of danch
> (Dan Christopherson)
> Sent: Tuesday, June 19, 2001 11:42 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-dev] Is findByPrimaryKey optimized enough in
> JAWS/CMP, even BMP?
>
>
> Bill Burke wrote:
>
> > The reason I ask is that it seems all finders go straight to the
> > Persistence manager with no optimizations in front of it. Couldn't
> > "findByPrimaryKey" look in the EntityInstanceCache and avoid a
> DB, "does
> > exist", call? Is this as easy as modifying
> > org.jboss.ejb.EntityContainer.find(...) ?? You're safe if
> > "findByPrimaryKey" has been overrided by the Bean developer because
> > org.jboss.jeb.EntityContainer.setupHomeMapping will not map the finder
> > to EntityContainer.find, but rather to the Bean class.
>
>
> I think this is the right place to do it - I wouldn't want the
> persistenceManager messing around in the cache (I had that at one point
> with the collection finder optimizations and it just increased system
> coupling with no performance advantage over what's there now (memory
> usage advantage, however))
>
> > At first glance,
> > I can't find words stating that this optimization is illegal, although
> > the Object Interaction Diagram does show a call to the database for
> > ejbFind. Comments?
> >
>
> I don't see anything wrong with a cache look-aside before hitting the DB.
>
In retrospect, maybe this optimization should only be done within the same
transaction. Consider this problem.
Thread 1
1. begin transaction
2. create bean 1234
Thread 2
3. findByPrimaryKey(1234)
Thread 1
4. rollback
findByPrimaryKey should not return non-committed stuff, correct?
Bill
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development