[jboss-as7-dev] detecting JPA usage in AS7 applications...

Marius Bogoevici marius.bogoevici at gmail.com
Fri Jun 10 13:17:11 EDT 2011


On 06/10/2011 06:24 AM, Scott Marlow wrote:
>> The reason I ask this is because if we introduce this feature, then just
>> relying on @PersistenceUnit and @PersistenceContext annotations won't be
>> enough, since users might lookup the EntityManagerFactory/EntityManager
>> via JNDI and in such cases too we will require the JPA module
>> dependencies to be added implicitly.
> It would be nice if users had the ability to explicitly mark a
> deployment as an EE JPA deployment or not a EE JPA deployment.
>
I agree with that. I suppose that in those cases, persistence annotation 
processing will be completely turned off. This would also help Spring 
applications that do not use EE JPA (even if that is what we would 
prefer them to do), but are adamant about using a META-INF/persistence.xml.

I was thinking that we could use  the jboss-ignore.txt feature, but 
right now, even that is not enough for getting those apps to work - even 
if the PU will not deploy, @PC/@PU annotations will be processed *and* 
validated, which means that the deployment will inevitably fail (no PU 
found).

How about having a special deployment descriptor 
(jboss-<something>.xml), which can be used for turning off blocks of 
features for a particular deployment (rather than not seeing 
META-INF/persistence.xml, you could simply have a 
<disable-jpa-deployer>true<disable-jpa-deployer/> flag). The presence of 
this flag could disable the whole subsystem for this particular 
deployment, in a more consistent fashion).


More information about the jboss-as7-dev mailing list