Java Reference
In-Depth Information
</bean>
<bean id="TransactionRetryInterceptor"
class="net.chrisrichardson.foodToGo.util.
bbbbbb b TransactionRetryInterceptor">
<property name="maxRetryCount" value="5"/>
</bean>
<beans>
The PlaceOrderService bean is implemented by the PlaceOrderServiceImpl
class and is injected with the PendingOrderRepository and the RestaurantRepos-
itory . The PlaceOrderServiceProxyCreator bean wraps the PlaceOrderService
with the TransactionRetryInterceptor and the TransactionInterceptor . Let's
now look at the persistence framework-specific details of the design, starting
with the JDO version.
8.5 Using JDO with an exposed domain model
In addition to the persistence framework-independent parts of the design that
you have just seen, there are some JDO -specific Spring beans and configuration
settings. The JDO -specific Spring beans are the JdoTransactionManager that is
used by the TransactionInterceptor , and the JDO PersistenceManagerFactory ,
which must be configured to support nontransactional reads. We must also con-
figure the web application to initialize the Spring WebApplicationContext and to
invoke the OpenPersistenceManagerInViewFilter , which is the servlet filter that
manages the PersistenceManager . Let's look at each of these.
8.5.1
Defining the Spring beans
Here are the Spring beans that configure the JdoTransactionManager and the
PersistenceManagerFactory :
<bean id="myTransactionManager"
class="org.springframework.orm.jdo.JdoTransactionManager">
<property name="persistenceManagerFactory"
BBBBB ref="myPersistenceManagerFactory"/>
</bean>
<bean id="myPersistenceManagerFactory"
EE class="org.springframework.orm.jdo.
bbbb LocalPersistenceManagerFactoryBean">
B <property name="jdoProperties">
 
 
 
 
 
 
 
Search WWH ::




Custom Search