AxonFramework/AxonFramework — Issue #19: Allow configuration of persistence unit in JPA-specific components
Author: abuijze
Created: 2011-12-03 14:51:26+00:00
State: open
Labels: Awaits Documentation

**What are the limitations you encounter in the current version? Please provide a simple use-case.**
Some of the components (e.g. JpaEventStore) use an EntityManager to retrieve entities from the persistent storage. This only works if it is a container managed EntityManager and there is only a single persistence unit.

**Please describe the enhancement you would like to have.**
If an application has multiple persistence units, it should be possible to configure the one to use.

**Do you have any ideas on how to implement the enhancement? If so, any suggestions are welcome.**
JPA uses annotations, which cannot be configured at runtime. Therefore, the EntityManager to use should be extracted in a "provider" class. In such case, an application developer could create a custom implementation that has the correct annotations.

See also: http://groups.google.com/group/axonframework/browse_thread/thread/d8a99c47a87f36e6