You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by Jean-Baptiste Onofré <jb...@nanthrax.net> on 2011/03/30 11:47:43 UTC

JTA and annotations

Hi guys,

currently, I use a Blueprint descriptor to define the transaction 
attribute associated to methods:

<bean id="myPojo" class="myPojo" init-method="init">
   <tx:transaction method="set*" value="Required"/>
   <tx:transaction method="get*" value="Supported"/>
</bean>

I think it could be interesting for the users to define transaction 
attributes directly in the POJO using annotations.

For instance, it could be helpful to support the following annotations:
@PostConstruct
@PreDestroy
@Resource
@TransactionAttribute

For instance, myPojo will look like:

public class MyPojo {

   @TransactionAttribute=Required
   public void setData(Data data) {
     ...
   }

}

WDYT ?

If you are OK, I will raise a Jira and start to work on it.

Regards
JB

Re: JTA and annotations

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the update Graham.

I will ping Lin Sun to work together.

Regards
JB

On 03/30/2011 05:03 PM, Graham Charters wrote:
> Hi Jean-Baptiste,
>
> I think this is a great idea.  You may be aware that Lin Sun did some
> prototyping of Blueprint annotations in the blueprint module (see the
> projects with "annotation" in their name.  I believe the design tried
> to replicate annotations matching the XML (e.g. an annotation per
> element).  It would be good to progress that activity for the things
> like @PostConstruct (there are Init and Destroy annotations), etc. and
> have the Transaction annotation follow a consistent design approach.
>
> Regards, Graham.
>
> On 30 March 2011 10:47, Jean-Baptiste Onofré<jb...@nanthrax.net>  wrote:
>> Hi guys,
>>
>> currently, I use a Blueprint descriptor to define the transaction attribute
>> associated to methods:
>>
>> <bean id="myPojo" class="myPojo" init-method="init">
>>   <tx:transaction method="set*" value="Required"/>
>>   <tx:transaction method="get*" value="Supported"/>
>> </bean>
>>
>> I think it could be interesting for the users to define transaction
>> attributes directly in the POJO using annotations.
>>
>> For instance, it could be helpful to support the following annotations:
>> @PostConstruct
>> @PreDestroy
>> @Resource
>> @TransactionAttribute
>>
>> For instance, myPojo will look like:
>>
>> public class MyPojo {
>>
>>   @TransactionAttribute=Required
>>   public void setData(Data data) {
>>     ...
>>   }
>>
>> }
>>
>> WDYT ?
>>
>> If you are OK, I will raise a Jira and start to work on it.
>>
>> Regards
>> JB
>>

Re: JTA and annotations

Posted by Graham Charters <gc...@gmail.com>.
Hi Jean-Baptiste,

I think this is a great idea.  You may be aware that Lin Sun did some
prototyping of Blueprint annotations in the blueprint module (see the
projects with "annotation" in their name.  I believe the design tried
to replicate annotations matching the XML (e.g. an annotation per
element).  It would be good to progress that activity for the things
like @PostConstruct (there are Init and Destroy annotations), etc. and
have the Transaction annotation follow a consistent design approach.

Regards, Graham.

On 30 March 2011 10:47, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Hi guys,
>
> currently, I use a Blueprint descriptor to define the transaction attribute
> associated to methods:
>
> <bean id="myPojo" class="myPojo" init-method="init">
>  <tx:transaction method="set*" value="Required"/>
>  <tx:transaction method="get*" value="Supported"/>
> </bean>
>
> I think it could be interesting for the users to define transaction
> attributes directly in the POJO using annotations.
>
> For instance, it could be helpful to support the following annotations:
> @PostConstruct
> @PreDestroy
> @Resource
> @TransactionAttribute
>
> For instance, myPojo will look like:
>
> public class MyPojo {
>
>  @TransactionAttribute=Required
>  public void setData(Data data) {
>    ...
>  }
>
> }
>
> WDYT ?
>
> If you are OK, I will raise a Jira and start to work on it.
>
> Regards
> JB
>