[jboss-user] [JBoss Seam] - Re: How to Extend Persistence Context Programatically

monkeyden do-not-reply at jboss.com
Mon Oct 1 16:45:40 EDT 2007


You can't inject something if you don't know the name.  If you have to determine the name at runtime, you'll have to do it inline.

<core:managed-persistence-context name="myManagername" auto-create="true" persistence-unit-jndi-name="java:/myjndiname">
  | </core:managed-persistence-context>


public void someMethod(){
  |     String emName = getEMName();
  |     EntityManager em = (EntityManager)Component.getInstance(emName, true);	
  | ...
  |     //do some work
  | }
  | 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090417#4090417

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090417



More information about the jboss-user mailing list