Mike Rubin wrote:
> 
> Hi,
        Hi,
> 
> I'm running JoNAS on a Mac. The server is up and running and I have built
> and am running the session EJB sample code.
> 
> When I run the client application, OpClient, the call to utx.begin() does
> not appear to do anything. If I turn on tracing, I do not see the trace
> message from the server indicating a call to begin(). Furthermore, I see
> trace messages stating that a new transaction has been started for buy()
> because none was in progress.
> 
> Looking at the source code, it appears that the UserTransaction interface
> is implemented in the Current class, but the Current class does not
> implement Remote. Is the client merely calling into its local copy of
> Current returned by lookup(). If so, is this a bug or a misunderstanding
> on my part.
No, it's a misunderstanding. It's true that in the client process, the Current
class is local to the process. Only when the client will call a remote bean
the transaction become a distributed transaction. The implicit propagation of the
transaction context insure that the bean will be aware that a transaction has
started, so the trace you see in the server then is normal.
> 
> Also, I think I found a bug in the OpBean.java class in this sample code.
> Shouldn't the conditional in the afterCompletion() method have an 'else'
> clause? Specifically:
> 
>    public void afterCompletion(boolean committed) throws RemoteException
>    {
>                    if (committed)
>                     total = newtotal;
>             else
>                     newtotal = total;   // set newtotal to rolled back total to
> handle read() outside of transaction
>     }
No, it's not a bug, because the line "newtotal = total" is in fact in after_begin().

> 
> Thank you for your help.
> 
> - Mike Rubin
> - Modulo Systems Corporation
        Regards,


-- 
Philippe Durieux  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED]  http://www-frec.bull.com
-> Download our EJBServer at http://www.bullsoft.com/ejb <-

Reply via email to