Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: JSF/JPA problem Date: Tue, 13 Sep 2011 15:38:48 -0700 Organization: A noiseless patient Spider Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 Sep 2011 22:38:51 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="10368"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zIShYYbg/M1oX+o5WtFH8LPGo+2w+FJA=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: Cancel-Lock: sha1:bhh1sCZcts2AX7sWJOhhfIfCylI= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7992 On 9/13/2011 1:40 PM, Arved Sandstrom wrote: >> You're using application-managed entity managers because of your use of >> an EntityManagerFactory. You must therefore use EntityTransaction. >> >> If you want container-managed then inject with @PersistenceContext, and >> specify JTA in your persistence.xml Wow, are you kidding me? I have three books and I've read the spec and don't recall seeing that piece of magic documentation. Could I trouble you to point out where you found it? (Yes, I'm using JEE 6 and JTA transactions.) > On a side note: if you're Java EE 6 (and judging by the > "postBean.createNewPost()" maybe you are) then you might want to use CDI > and the @Named and @Inject annotations rather than @ManagedBean and > @ManagedProperty. With a Java EE 6 server (like Glassfish 3) you'll have > the Weld reference implementation of CDI Yes, I have CDI available. I haven't read up on CDI completely yet, and it's a bit more involved than ManagedBean/ManagedProperty, so I'm playing with those two while I come up to speed on CDI. It'll happen soon.