Re: [jira] Created: (OPENEJB-847) @Resource UserTransaction injection on bean with Container-Managed Transactions

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [jira] Created: (OPENEJB-847) @Resource UserTransaction injection on bean with Container-Managed Transactions

by Jacek Laskowski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 3, 2008 at 1:24 AM, David Blevins (JIRA) <jira@...> 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 as it's the last checkin I'm
reviewing to get me started? Should I do the check for @Resource
UserTransaction in AppValidator? It seems to be the best place for it.

Jacek

--
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Re: [jira] Created: (OPENEJB-847) @Resource UserTransaction injection on bean with Container-Managed Transactions

by David Blevins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

> On Thu, Jul 3, 2008 at 1:24 AM, David Blevins (JIRA)  
> <jira@...> 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


Re: [jira] Created: (OPENEJB-847) @Resource UserTransaction injection on bean with Container-Managed Transactions

by Jacek Laskowski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 10, 2008 at 8:19 AM, David Blevins <david.blevins@...> wrote:

>> 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?

Enough for now to let me move on. Thanks.

Jacek

--
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl
LightInTheBox - Buy quality products at wholesale price