Just to keep things even, I agree with Marc. This case is
specifically described in 7.4.2 of EJB 2.0 PFD2:

<7.4.2>A session object�s conversational state is not
transactional. It is not automatically rolled back to its initial state if
the transaction in which the object has participated rolls back.

If a rollback could result in an inconsistency between a session
object�s conversational state and the state of the underlying
database, the bean developer (or the application development tools
used by the developer) must use the afterCompletion notification to
manually reset its state.</7.4.2>

The only automatic ejection from the cache should happen with a
system exception. Even for an entity bean, we don't necessarily
want to toss it from the cache on a rollback, in case the bean
developer has acquired expensive per-instance resources (as
Rickard was suggesting in his earlier messages about entity beans
and the cache).

-Dan

On 3 Jul 01, at 14:35, danch (Dan Christopherson) wrote:

> I agree with Bill - removing everything involved in the rolled-back
> transaction from the cache is a must.
>
> -danch
>
> Bill Burke wrote:
>
> > Nope, with the old code, B would be removed from the cache when b.remove()
> > was called even if it was invoked from within a transaction.  Also, all
> > beans involved with a transaction would be removed from the cache on a
> > rollback within InstanceSynchronization.
> >
> > I think that is the safe and correct approach to remove any bean from the
> > cache that is part of a rollback.  Otherwise you may have corrupted data.
> >
> > Bill
> >
> >
> >>-----Original Message-----
> >>From: [EMAIL PROTECTED]
> >>[mailto:[EMAIL PROTECTED]]On Behalf Of marc
> >>fleury
> >>Sent: Tuesday, July 03, 2001 2:57 PM
> >>To: Jboss-Development@Lists. Sourceforge. Net
> >>Subject: [JBoss-dev] remove transactional
> >>
> >>
> >>as I wrap up the stuff, sanity check
> >>
> >>bean a and bean b
> >>
> >>a starts transaction and calls b.remove() and then rolls back
> >>
> >>b is still there in cache right?
> >>
> >>marcf
> >>
> >>_________________
> >>Marc Fleury, Ph.D
> >>[EMAIL PROTECTED]
> >>_________________
>
>
>
> _______________________________________________
> 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