You don't need to keep track of who is updated.  The bean will know if it
has been updated or not, with isModified, and/or <tuned-updates> with JAWS.
The following logic is done everywhere(actually only in
EntitySynchronizationInterceptor and InstanceSynchronization) before storing
the bean:

boolean dirty = true;
if (isModified != null)
{
   try
   {
      dirty = ((Boolean)isModified.invoke(ctx.getInstance(), new
Object[0])).booleanValue();
   } catch (Exception e)
   {
      // Ignore
   }
}

if (dirty)
    container.getPersistenceManager().storeEntity(ctx);

Am I correct here?  Again,  let me know if you want me to check in these
changes...


Bill


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of marc
> fleury
> Sent: Wednesday, June 13, 2001 6:13 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [JBoss-dev] No storeEntity before ejbFind<METHOD>
>
>
> hmmmm
>
> for example when the real transaction commits, what do you do? do you
> re-store the stuff? or do you correctly keep track of who is
> updated through
> setting the dirty flag?
>
> This is good stuff ...
>
> marcf
> ____________________________________
> "but I think you are moving to fast"
> -- Some popular rap song --
> ____________________________________
>
>
>
> |-----Original Message-----
> |From: [EMAIL PROTECTED]
> |[mailto:[EMAIL PROTECTED]]On Behalf Of Bill
> |Burke
> |Sent: Wednesday, June 13, 2001 5:33 PM
> |To: Jboss-Development@Lists. Sourceforge. Net
> |Subject: [JBoss-dev] No storeEntity before ejbFind<METHOD>
> |
> |
> |The EJB spec 2.0 reads.... 9.6.4
> |
> |"Before invoking the ejbFind<METHOD>(...) method, the container
> must first
> |synchronize the state of any entity bean instances that are
> |participating in
> |the same transaction context as is used to execute the
> ejbFind<METHOD>(...)
> |by invoking the ejbStore() method on those entity bean instances."
> |
> |JBoss is not doing this.
> |
> |We really needed this change, so I implemented it.  Let me know
> if you want
> |me to commit it.  If I get no response in a few days, I'll just commit it
> |anyways...Isn't that the way it works?
> |
> |Summary of changes:
> |
> |- Created a new class TxEntityMap that maps transactions to the entities
> |that are associated with that transaction
> |- Added an instance to TxEntityMap to EntityContainer
> |- EntitySynchronizationInterceptor.register(...) associates the
> transaction
> |with the entity bean into the TxEntityMap
> |-
> |EntitySynchronizationInterceptor.InstanceSynchronization.afterCom
> pletion()
> |disassociates the entity with the transaction
> |- Don't worry,  I'm pretty sure I clean up everything.
> |
> |Bill
> |
> |
> |
> |_______________________________________________
> |Jboss-development mailing list
> |[EMAIL PROTECTED]
> |http://lists.sourceforge.net/lists/listinfo/jboss-development
>
>
>
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>



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

Reply via email to