Very strangely, even "java:comp/UserTransaction" doesn't work but finally, I
got the JTA working by using the String "jta/UserTransaction" in the
lookup....

Thanks for all the help....
Dinesh

> -----Original Message-----
> From: Benjamin BONNET [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 24, 2001 12:56 PM
> To:   Pratap Dinesh
> Cc:   [EMAIL PROTECTED]
> Subject:      Re: JTA
>
> Hi,
> The UserTransaction should be available in JNDI to BMT sessions... Have
> you
> tried this:
> ...
> Context ic = new InitialContext();
> UserTransaction ut = (UserTransaction)
> ic.lookup("java:comp/UserTransaction");
> ut.begin();
> ...
>
> According to the specs (EJB2.0 19.7), it should be equivalent to a
> "sessioncontext.getUserTransaction()".
>
> Benjamin
>
> Pratap Dinesh a �crit :
>
> >         Well,
> >
> >         javax.ejb.sessionContext.getUserTransaction(); works but I'm
> amazed
> > as to why JNDI lookup is not working....
> >       Any clues ??
> >
> >       Dinesh
> >
> > > -----Original Message-----
> > > From: mani [SMTP:[EMAIL PROTECTED]]
> > > Sent: Monday, April 23, 2001 4:16 PM
> > > To:   Pratap Dinesh; [EMAIL PROTECTED]
> > > Subject:      Re:      JTA
> > >
> > > try this
> > >
> > > UserTransaction ut==sessionContext.getUserTransaction();
> > > ut.begin();
> > >
> > > u must set the sessionContext variable in the setSessionContext()
> method.
> > >
> > > regards,
> > > mani
> > >
> > >
> > > ----- Original Message -----
> > > From: "Pratap Dinesh" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, April 23, 2001 3:48 PM
> > > Subject: JTA
> > >
> > >
> > > > I wish to invoke UserTransaction using the following code:
> > > >
> > > > Context ic = new InitialContext();
> > > > UserTransaction ut = (UserTransaction)
> > > > ic.lookup("javax.transaction.UserTransaction");
> > > > ut.begin();
> > > >
> > > > This snippet is giving me a runtime Exception ... What is the
> problem in
> > > > this code.. Can't see through...
> > > >
> > > > Need help on this one..
> > > > Thanks
> > > >
> > > > Dinesh
> > > >
> > > >
> > >
> ==========================================================================
> > > =
> > > > 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".
> >
> >
> ==========================================================================
> =
> > 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".

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