title: How do you create an EntityManager when you are unsure of the unit name?
body: <p>I'm in a situation where I need to determine the EntityManager's unit name at run time.</p>
  
  <p>For example, I'd like to do something like this:</p>
  
  <pre><code>@PersistenceContext(unitName = findAppropriateJdbcName())
  EntityManager entityManager;
  </code></pre>
  
  <p>However, this is not possible with annotations.</p>
  
  <p>Is it possible to create the EntityManager when your not sure of what the unit name is until run time?</p>