[jboss-dev-forums] [JBoss AS7 Development] - Re: jboss7 quickstarts entitymanager injection question

robert walker do-not-reply at jboss.com
Mon Nov 7 17:04:06 EST 2011


robert walker [http://community.jboss.org/people/robertwalker] created the discussion

"Re: jboss7 quickstarts entitymanager injection question"

To view the discussion, visit: http://community.jboss.org/message/635436#635436

--------------------------------------------------------------
ok, this is becoming a bit clearer, 

however

both examples (login and kitchensink) point to 

<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>

in thier persistence.xml (each one gives a different name for thier persistence-unit name, one named primary and the other loginDatabase)

so because both point to same the DS then 

@Inject
EntityManager

works in both sample applications? Jboss can know which pu to assign to the entitymanager?

the login app would not get associated with the PU for kithensink?


If I add my own, do I also use
@Inject   // or maybe  @PersistenceContext if not using the resource producer pattern

private EntityManager em;

thanks


--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/635436#635436]

Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20111107/03f72755/attachment.html 


More information about the jboss-dev-forums mailing list