i had problems persisting a user to the database unless having my pc named entityManager:
<persistence:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="java:/myEntityManagerFactory"/> <security:jpa-identity-store user-class="MyUser" role-class="MyRole"/>
did i miss sth?
what do you think about having some indirection like
<persistence:managed-persistence-context name="anotherNameForEntityManager" auto-create="true" persistence-unit-jndi-name="java:/myEntityManagerFactory"/> <security:jpa-identity-store entity-manager="anotherNameForEntityManager" user-class="MyUser" role-class="MyRole"/>
so that you can map the identity store to whatever PC you'd like?
it's all about init() in JPAIdentityStore.java, right?
@Create public void init() { ... if (entityManager == null) { entityManager = Expressions.instance().createValueExpression("#{entityManager}", EntityManager.class); } ...
thx for your time.
torben
This is already supported, just set a value for entity-manager in components.xml:
<security:jpa-identity-store entity-manager="#{otherEntityManager}" user-class="org.myapp.User" role-class="org.myapp.Role"/>