|
|
|
@ -425,12 +425,14 @@ TR: REVISED, PLS REVIEW.-->This declarative transaction capability allows you |
|
|
|
|
|
|
|
|
|
|
|
<lineannotation><!-- <interfacename>SessionFactory</interfacename>, <interfacename>DataSource</interfacename>, etc. omitted --></lineannotation> |
|
|
|
<lineannotation><!-- <interfacename>SessionFactory</interfacename>, <interfacename>DataSource</interfacename>, etc. omitted --></lineannotation> |
|
|
|
|
|
|
|
|
|
|
|
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> |
|
|
|
<bean id="transactionManager" |
|
|
|
|
|
|
|
class="org.springframework.orm.hibernate3.HibernateTransactionManager"> |
|
|
|
<property name="sessionFactory" ref="sessionFactory"/> |
|
|
|
<property name="sessionFactory" ref="sessionFactory"/> |
|
|
|
</bean> |
|
|
|
</bean> |
|
|
|
|
|
|
|
|
|
|
|
<aop:config> |
|
|
|
<aop:config> |
|
|
|
<aop:pointcut id="productServiceMethods" expression="execution(* product.ProductService.*(..))"/> |
|
|
|
<aop:pointcut id="productServiceMethods" |
|
|
|
|
|
|
|
expression="execution(* product.ProductService.*(..))"/> |
|
|
|
<aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods"/> |
|
|
|
<aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods"/> |
|
|
|
</aop:config> |
|
|
|
</aop:config> |
|
|
|
|
|
|
|
|
|
|
|
@ -459,7 +461,8 @@ TR: REVISED, PLS REVIEW.-->This declarative transaction capability allows you |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
<lineannotation>// notice the absence of transaction demarcation code in this method</lineannotation> |
|
|
|
<lineannotation>// notice the absence of transaction demarcation code in this method</lineannotation> |
|
|
|
<lineannotation>// Spring's declarative transaction infrastructure will be demarcating transactions on your behalf </lineannotation> |
|
|
|
<lineannotation>// Spring's declarative transaction infrastructure will be demarcating</lineannotation> |
|
|
|
|
|
|
|
<lineannotation>// transactions on your behalf </lineannotation> |
|
|
|
public void increasePriceOfAllProductsInCategory(final String category) { |
|
|
|
public void increasePriceOfAllProductsInCategory(final String category) { |
|
|
|
List productsToChange = this.productDao.loadProductsByCategory(category); |
|
|
|
List productsToChange = this.productDao.loadProductsByCategory(category); |
|
|
|
<lineannotation>// ...</lineannotation> |
|
|
|
<lineannotation>// ...</lineannotation> |
|
|
|
@ -515,7 +518,8 @@ TR: REVISED, PLS REVIEW.-->This declarative transaction capability allows you |
|
|
|
|
|
|
|
|
|
|
|
<lineannotation><!-- <interfacename>SessionFactory</interfacename>, <interfacename>DataSource</interfacename>, etc. omitted --></lineannotation> |
|
|
|
<lineannotation><!-- <interfacename>SessionFactory</interfacename>, <interfacename>DataSource</interfacename>, etc. omitted --></lineannotation> |
|
|
|
|
|
|
|
|
|
|
|
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> |
|
|
|
<bean id="transactionManager" |
|
|
|
|
|
|
|
class="org.springframework.orm.hibernate3.HibernateTransactionManager"> |
|
|
|
<property name="sessionFactory" ref="sessionFactory"/> |
|
|
|
<property name="sessionFactory" ref="sessionFactory"/> |
|
|
|
</bean> |
|
|
|
</bean> |
|
|
|
|
|
|
|
|
|
|
|
@ -633,7 +637,8 @@ TR: REVISED, PLS REVIEW.-->This declarative transaction capability allows you |
|
|
|
|
|
|
|
|
|
|
|
<jee:jndi-lookup id="dataSource2" jndi-name="java:comp/env/jdbc/myds2"/> |
|
|
|
<jee:jndi-lookup id="dataSource2" jndi-name="java:comp/env/jdbc/myds2"/> |
|
|
|
|
|
|
|
|
|
|
|
<bean id="mySessionFactory1" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> |
|
|
|
<bean id="mySessionFactory1" |
|
|
|
|
|
|
|
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> |
|
|
|
<property name="dataSource" ref="myDataSource1"/> |
|
|
|
<property name="dataSource" ref="myDataSource1"/> |
|
|
|
<property name="mappingResources"> |
|
|
|
<property name="mappingResources"> |
|
|
|
<list> |
|
|
|
<list> |
|
|
|
@ -648,7 +653,8 @@ TR: REVISED, PLS REVIEW.-->This declarative transaction capability allows you |
|
|
|
</property> |
|
|
|
</property> |
|
|
|
</bean> |
|
|
|
</bean> |
|
|
|
|
|
|
|
|
|
|
|
<bean id="mySessionFactory2" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> |
|
|
|
<bean id="mySessionFactory2" |
|
|
|
|
|
|
|
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> |
|
|
|
<property name="dataSource" ref="myDataSource2"/> |
|
|
|
<property name="dataSource" ref="myDataSource2"/> |
|
|
|
<property name="mappingResources"> |
|
|
|
<property name="mappingResources"> |
|
|
|
<list> |
|
|
|
<list> |
|
|
|
@ -678,7 +684,8 @@ TR: REVISED, PLS REVIEW.-->This declarative transaction capability allows you |
|
|
|
</bean> |
|
|
|
</bean> |
|
|
|
|
|
|
|
|
|
|
|
<aop:config> |
|
|
|
<aop:config> |
|
|
|
<aop:pointcut id="productServiceMethods" expression="execution(* product.ProductService.*(..))"/> |
|
|
|
<aop:pointcut id="productServiceMethods" |
|
|
|
|
|
|
|
expression="execution(* product.ProductService.*(..))"/> |
|
|
|
<aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods"/> |
|
|
|
<aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods"/> |
|
|
|
</aop:config> |
|
|
|
</aop:config> |
|
|
|
|
|
|
|
|
|
|
|
@ -1169,7 +1176,8 @@ TR: OK AS IS. Two different callback methhods - one is Spring's (*afterCompletio |
|
|
|
</tx:advice> |
|
|
|
</tx:advice> |
|
|
|
|
|
|
|
|
|
|
|
<aop:config> |
|
|
|
<aop:config> |
|
|
|
<aop:pointcut id="productServiceMethods" expression="execution(* product.ProductService.*(..))"/> |
|
|
|
<aop:pointcut id="productServiceMethods" |
|
|
|
|
|
|
|
expression="execution(* product.ProductService.*(..))"/> |
|
|
|
<aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods"/> |
|
|
|
<aop:advisor advice-ref="txAdvice" pointcut-ref="productServiceMethods"/> |
|
|
|
</aop:config> |
|
|
|
</aop:config> |
|
|
|
|
|
|
|
|
|
|
|
@ -1504,7 +1512,8 @@ TR: OK AS IS. The requirement is to provide the classloader for the runtime envi |
|
|
|
file:</para> |
|
|
|
file:</para> |
|
|
|
|
|
|
|
|
|
|
|
<programlisting language="xml"><Context path="/myWebApp" docBase="/my/webApp/location"> |
|
|
|
<programlisting language="xml"><Context path="/myWebApp" docBase="/my/webApp/location"> |
|
|
|
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/> |
|
|
|
<Loader |
|
|
|
|
|
|
|
loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/> |
|
|
|
</Context></programlisting> |
|
|
|
</Context></programlisting> |
|
|
|
|
|
|
|
|
|
|
|
<para>Tomcat 5.0.x and 5.5.x series support several context |
|
|
|
<para>Tomcat 5.0.x and 5.5.x series support several context |
|
|
|
@ -1539,7 +1548,8 @@ TR: REVISED, PLS REVIEW. Chnaged the last one to *inside*--> is recommended |
|
|
|
<emphasis>useSystemClassLoaderAsParent</emphasis> to |
|
|
|
<emphasis>useSystemClassLoaderAsParent</emphasis> to |
|
|
|
<literal>false</literal> to fix the problem: <programlisting |
|
|
|
<literal>false</literal> to fix the problem: <programlisting |
|
|
|
language="xml"><Context path="/myWebApp" docBase="/my/webApp/location"> |
|
|
|
language="xml"><Context path="/myWebApp" docBase="/my/webApp/location"> |
|
|
|
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader" |
|
|
|
<Loader |
|
|
|
|
|
|
|
loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader" |
|
|
|
useSystemClassLoaderAsParent="false"/> |
|
|
|
useSystemClassLoaderAsParent="false"/> |
|
|
|
</Context></programlisting></para> |
|
|
|
</Context></programlisting></para> |
|
|
|
</listitem> |
|
|
|
</listitem> |
|
|
|
@ -1563,7 +1573,8 @@ TR: REVISED, PLS REVIEW. Chnaged the last one to *inside*--> is recommended |
|
|
|
file:</para> |
|
|
|
file:</para> |
|
|
|
|
|
|
|
|
|
|
|
<programlisting language="xml"><Context path="/myWebApp" docBase="/my/webApp/location"> |
|
|
|
<programlisting language="xml"><Context path="/myWebApp" docBase="/my/webApp/location"> |
|
|
|
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/> |
|
|
|
<Loader |
|
|
|
|
|
|
|
loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/> |
|
|
|
</Context></programlisting> |
|
|
|
</Context></programlisting> |
|
|
|
|
|
|
|
|
|
|
|
<para>The Tomcat 6.0.x (similar to 5.0.x/5.5.x) series |
|
|
|
<para>The Tomcat 6.0.x (similar to 5.0.x/5.5.x) series |
|
|
|
|