James Cook wrote:
> My EJB server *does* support JTA. Do you get the current UserTransaction and
> type cast it to javax.transaction.Transaction? This looks promising.
UserTransaction is not available when using container managed persistence, which we
are. Some server provide a way to get the transaction manager, but I don't know if
there is a standard. JNDI lookup maybe?
>
>
> When you mention SessionSynchronization, I am not using any StaefulSessionBeans
> currently. Do you end up creating one from a SLSB?
No, we just call create on the home interface.
> If so, doesn't this cause
> other problems with timeouts and such? I think that this practice is
> discouraged.
We do have to deal with time-outs which is a pain. We really need a notification on
the client when time-outs occur. I would also like it if all server vendors
supported time-outs from last use rather than from creation.
We use stateful session beans for the use cases where editing complex object graphs
is needed. The choice is to keep the state in the client and pass it in with each
method call, or keep in on the server and reduce network traffic. It's a tradeoff
with no correct answer for every situation. We're not expecting more than a several
dozen stateful session beans active at any one time. Besides, this gives us a way to
modify complex processing code without having to update the client.
Back to the original question. If you're using stateless session beans, you don't
really need the SessionSynchronization interface. We use a try ... finally statement
to clean up at the end of each method. You'll have to deal with nested calls to
method with Required transaction attributes.
--Victor
>
>
> thank you,
> jim
>
> ----- Original Message -----
> From: "Victor Langelo" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 29, 2000 10:55 AM
> Subject: Re: Hitching a ride on a context?
>
> > Jim,
> >
> > We've had pretty good luck associating objects with a thread. I use the
> session
> > bean's SessionSynchronization interface to setup and remove the association.
> This
> > has worked for use in three different EJB servers so far.
> >
> > If you EJB server supports JTA you'd be better off using the enlistResource
> method
> > of javax.transaction.Transaction.
> >
> > --Victor Langelo
> >
> >
===========================================================================
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".