Title: Commit a Transaction Hi, I found that @Inject annotation is used at BTM example. At point 1. Call the commit() method on the UserTransaction there is used in code notation: @Inject private UserTransaction userTransaction; it does not work in Java EE 6. Please change it to @Resource private UserTransaction userTransaction; In case the title of point 1. could be change to contain information about bean managed transaction "mode". Title could be something like: If you use Bean Managed Transactions (BMT), call the commit() method on the UserTransaction Thank you Ondra
Ondrej, all the quickstarts use the @Inject and work fine with Java EE 6. Check out the code in the following quickstarts: bmt cdi-veto greeter jta-crash-rec Adding Mike and Tom to get more clarification.
The Oracle documentation uses @Resource: http://docs.oracle.com/javaee/6/tutorial/doc/gmgli.html http://docs.oracle.com/javaee/7/tutorial/doc/cdi-adv004.htm It sounds like we do need to change the documentation and the quickstarts. Waiting to see what Mike and Tom say.
You can inject UserTransaction in to a CDI bean in Java EE 6. This is defined in CDI 1.0 Section 3.6 (http://docs.jboss.org/cdi/spec/1.0/html_single/#d0e2363). If this does not work, it is a bug in EAP NOT the quickstart.
Setting devel nack to -
Thanks Pete. Because the quickstarts all work and were tested thoroughly by QA, I am not changing the code example in the documentation. Closing this as not a bug.
Yeap, sorry Sande. I was terribly mistaken. I did a mistake in my deployment and as I saw that the most documentation about the injection of UserTransaction points to injection by resource so I thought that injection by Inject is rather feature of java ee 7. Once again, sorry for this bug.