Richard Monson-Haefel schrieb:
> Rickard �berg wrote:
>
> > Hey
> >
> > If I have a bean FooBean which have two methods, doSomething and fooBar,
> > of which doSomething has tx setting SUPPORTS and fooBar has REQUIRED.
> > What happens if a client (without a tx) calls doSomething, and that
> > method calls fooBar in the same bean? Then the fooBar method would be
> > executed without a transaction since there is no EJBObject that is being
> > called that can start the tx.
> >
> > So, is this a bad idea? (rhethoric)
> >
> > The workaround would be to do ctx.getEJBObject() in doSomething and call
> > fooBar through that, which could start the tx.
> > \
>
> Actually this would not work. A bean identity can not service two different tx
> contexts. Since doSomething is executing without a tx and fooBar requires a tx,
> an exception would occur when you executed fooBar( ) on the EJBObject returned
> by ctx.getEJBObject() within the doSomething method. (There are also reentrant
> considerations but that's off subject.)
>
Richard,
(reentrant presumed), why doesn't it work? As far as I understand the EJB spec, the
EJBObject implementation must start a new transaction for fooBar() for TX_REQUIRED
and throw an exception for TX_MANDATORY.
What do you understand under tx context? What's the difference betwen the tx and
the thread context?
Regards.
--
Francis Pouatcha
MATHEMA Software GmbH
N�gelsbachstra�e 25 a
91052 E r l a n g e n
Telefon 09131/8903-0
Telefax 09131/8903-55
http://www.mathema.de
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".