Hi,
I want to use Toplinks EntityManagerFactoryProvider.DDL_GENERATION feature in
a safe way.
I used to use
Persistence.createEntityManagerFactory(...) / emf.createEntityManager();
however this way I cannot use a jta-data-source (I guess because this EM is
not containermanaged).
So I wanted to move this to a SessionBean getting a EM injected by:
@PersistenceContext(type=PersistenceContextType.EXTENDED, properties={
@PersistenceProperty(name=EntityManagerFactoryProvider.DDL_GENERATION,
value=EntityManagerFactoryProvider.DROP_AND_CREATE)
})
However I feel queasy about this because I totally loose control over the time
of execution and I see no way to synchronize this at all. The only place I
see to do at least some preparations is the SessionBean constructor.
Is there any good way to do this?
Best Regards
Klaus