I'm getting a different exception related to conflicting jpql queries.
If I remove the NamedQueries, and use <jta-data-source>jdbc/__default</jta-data-source> (the default JavaDB datasource in GlassFish), all works well for me (same GlassFish 3.1 version).
-Alexis
On 5 mai 2011, at 15:06, forums_at_java.net wrote:
> My persistence.xml:
>
> <persistence-unit name="qDBJPA"
> transaction-type="JTA">
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> <jta-data-source>qDB</jta-data-source>
> <non-jta-data-source>qDBNonJta</non-jta-data-source>
> <class>de.mycompany.TemplateQuestionaire</class>
> </persistence-unit>
>
> My classes:
>
> @Entity
> @Table(name = "TEMPLATE_QUESTIONAIRE")
> @NamedQueries( { @NamedQuery(name = "findAllQuestionaires", query = "select
> tq from TemplateQuestionaire tq"),
> @NamedQuery(name = "findQuestionairesByID", query = "select tq
> from TemplateQuestionaire tq where tq.qID = :mainID") })
> public class TemplateQuestionaire implements Serializable {
> @Id
> @Column(name = "qID", length = 50)
> @NotNull
> private String templateQuestionaireId;
> ...
> }
> @Stateless
> @LocalBean
> @TransactionAttribute(TransactionAttributeType.REQUIRED)
> public class TemplateService implements TemplateServiceLocal,
> TemplateServiceRemote {
> @PersistenceContext(unitName = "qDBJPA")
> private EntityManager em;
> public TemplateQuestionaire loadTemplateQuestionaire(String
> templateQuestionaireId) {
> return em.find(TemplateQuestionaire.class, templateQuestionaireId);
> }
> }
>
>
>
>
> --
>
> [Message sent by forum member 'MohamzJava']
>
> View Post: http://forums.java.net/node/798500
>
>