• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Injecting @Resource UserTransaction results in null

 
B Nirvan
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use JTA transactions (without EJB) in my JPA project. I am trying to inject UserTransaction using the following code in one of my java class


but nothing gets injected and the tran variable is null. Am I missing out any configuration steps. I am using Glassfish V3.

regards,
Nirvan.
 
Tim Hagberg
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They need to be on the same line like this:
 
B Nirvan
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, but that doesn't work either.

regards,
Nirvan
 
B Nirvan
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to inject @Resource UserTransaction into a non-managed object (object created with new).

regards,
Nirvan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic