Not so fast my friend ...

I did misspeak though. Spec I was meanig to refer to is EJB 2.0. To be
sure "Enterprise JavaBeans Specification, Version 2.0, Proposed Final
Draft, October 23, 2000".

Look at page 202.

A snippet -

"The container provides an implementation of the TransactionManager
interface to the Persistence Manager through JNDI. The Persistence
Manager can locate the TransactionManager through the standard JNDI API
as java:pm/TransactionManager".

-harsh-



> I'm not sure there is any standard to accessing a transaction manager
> from an ejbean. Here's what the J2EE 1.2 spec has to say:
>
>      JTA also defines a number of interfaces that would be used
>      by an application
>      server to communicate with a transaction manager, and for a
>      transaction
>      manager to interact with a resource manager. JTA does not
>      architect any method
>      for acquiring an appropriate TransactionManager object, and
>      this
>      specification does not require any objects implementing that
>      interface to be
>      available from the J2EE platform. Similarly, a J2EE product
>      need not support
>      objects that implement the XAResource interface. A future
>      version of this
>      specification may require support for these application
>      server APIs. Of course,
>      support for other distributed transaction facilities may be
>      provided by the
>      platform, transparently to the application.
>
> The proposed J2EE 1.3 spec says that the transaction manager
> interfaces are available as specified in the J2EE Connector spec. I
> guess this means that resource managers can register XAResources, but
> enterprise beans are not supposed to do so directly.
>
> --Victor


> > > > 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?

> > Yes. You can (/should be able to) use
> > xxx.lookup("java:pm/TransactionManager"), where pm is the JNDI key
> > for a
> > PersistenceManager, TransactionManager being one entity that aids in
> >
> > Persistence. Interestingly this is detailed in the J2EE spec.
> >
> > -harsh-

===========================================================================
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".

Reply via email to