users@glassfish.java.net
Re: EntityManager Lookup via jndi
This message
: [
Message body
] [ More options (
top
,
bottom
) ]
Related messages
: [
Next message
] [
Previous message
] [
In reply to
] [
Next in thread
]
Contemporary messages sorted
: [
by date
] [
by thread
] [
by subject
] [
by author
] [
by messages with attachments
]
From
: <
glassfish_at_javadesktop.org
>
Date
: Fri, 19 Dec 2008 12:43:24 PST
persistence.xml:
<persistence version="1.0" xmlns="
http://java.sun.com/xml/ns/persistence
" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance
" xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
">
<persistence-unit name="lmap-enterprise" transaction-type="JTA">
<jta-data-source>jdbc/lmap-enterprise</jta-data-source>
</persistence-unit>
-----------------------------------------------------------------
PatientServiceBean.java:
@Stateless
public class PatientServiceBean implements PatientServiceLocal {
@Resource
SessionContext context;
public EntityManager getEm() {
String persistenceContextRefName = "lmap-enterprise";
return EntityManager.class.cast(
context.lookup(persistenceContextRefName));
}
Good Luck,
Vladimir
[Message sent by forum member 'vladperl' (vladperl)]
http://forums.java.net/jive/thread.jspa?messageID=322714
This message
: [
Message body
]
Next message
:
glassfish_at_javadesktop.org: "Re: Glassfish installation help. Nodeagent."
Previous message
:
Mitesh Meswani: "Re: EntityManager Lookup via jndi"
In reply to
:
glassfish_at_javadesktop.org: "EntityManager Lookup via jndi"
Next in thread
:
Mitesh Meswani: "Re: EntityManager Lookup via jndi"
Contemporary messages sorted
: [
by date
] [
by thread
] [
by subject
] [
by author
] [
by messages with attachments
]