users@glassfish.java.net

Re: how to get a userTransaction from application client?

From: sankara rao bhogi <Sankara.Rao_at_Sun.COM>
Date: Mon, 04 Jun 2007 14:32:51 +0530

Legolas wood wrote:
> Hi
> I am trying to get a userTransaction in application client.
> I managed to acquire it when i use web application but it looks like
> that the same methods does not works in application client.
>
> here is my code to get it in web application :
>
>
>
> @Resource
> private javax.transaction.UserTransaction utx;

You need to use the JNDI ("java:comp/UserTransaction") to lookup the
UserTransaction. Resource injection wouldn't work as transactions
support is not required in clients as per the specification.

regards
sankar
>
>
> now can you tell me how to get it in application client?
> the above code return error.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>