On Jul 4, 2008, at 2:25 PM, Jacek Laskowski wrote:

On Thu, Jul 3, 2008 at 1:24 AM, David Blevins (JIRA) <[EMAIL PROTECTED]> wrote:
@Resource UserTransaction injection on bean with Container-Managed Transactions
-------------------------------------------------------------------------------

               Key: OPENEJB-847
               URL: https://issues.apache.org/jira/browse/OPENEJB-847
           Project: OpenEJB
        Issue Type: Sub-task
          Reporter: David Blevins

I'm going to work on it, but wonder why checkAttributes(new
TransactionAttributeHandler(assemblyDescriptor, ejbName), ejbName,
ejbModule, classFinder, "invalidTransactionAttribute"); is in
AnnnotationDeployer not AppValidator

We generally shoot to keep validation out of the AnnotationDeployer but that seemed like one of those cases where 80% of the logic would have to be duplicated if we moved it out.

Should I do the check for @Resource
UserTransaction in AppValidator? It seems to be the best place for it.

I'd say yes. In the AppValidator we wouldn't exactly know if the UserTransaction ref originated in xml or annotation, but I don't think it strictly matters. You can just check the resource-env-ref elements of the jaxb tree and ... well i guess there's a couple things we could do. We could:

- issue a warning, then automatically remove the UserTransaction ref and let deployment continue
 - issue a failure which will of course fail the deployment

There could be good arguments for either one.  Thoughts?

-David

Reply via email to