|
From: Cameron B. <ca...@da...> - 2004-03-11 01:31:18
|
Yeah, I am using commons attributes for transaction declaration. We have a system where we use a method name match transaction attribute source as the fallback, and allow declarations on at the method level to override these defaults, since most of the time the defaults work perfectly, and these defaults are defined per application anyway. Something like this in applicationContext.xml <bean id="commonsAttributes" class="org.springframework.metadata.commons.CommonsAttributes"/> <!-- transaction attribute source to provide a method name based map --> <bean id="attributesMatchMethodNamePattern" class="org.springframework.transaction.interceptor.NameMatchTransactionAttri buteSource"> <property name="properties"> <props> <!-- read only methods --> <prop key="list*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> <!-- the default is transactional (least specific, match everything) --> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean id="attributesAttributeSource" class="org.springframework.transaction.interceptor.AttributesTransactionAttr ibuteSource"> <constructor-arg><ref bean="commonsAttributes"/></constructor-arg> </bean> <bean id="multiAttributeSource" class="transaction.interceptor.ListTransactionAttributeSource"> <property name="attributeSources"> <list> <ref bean="attributesAttributeSource"/> <ref bean="attributesMatchMethodNamePattern"/> </list> </property> </bean> > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] > On Behalf Of Rod Johnson > Sent: Thursday, 11 March 2004 10:00 AM > To: spr...@li... > Subject: Re: [Springframework-developer] commons attributes questions > > > I'm glad to learn we can shorten the attribute declarations > by leaving > > off the package. Very nice! > > That was actually my suggestion, based on Mark's attrib4j. I > also requested the support for JavaBean properties, to make > it easier to use with Spring. > > Is anyone using Commons Attributes for declarative tx mgt (as > in jPetStore /attributes)? > > Or the commons attributes handler mapping? > > Regards, > Rod > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials Free > Linux tutorial presented by Daniel Robbins, President and CEO > of GenToo technologies. Learn everything from fundamentals to > system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |