当前位置: 首页 > news >正文

美术馆网站的建设流程境外服务器租用

美术馆网站的建设流程,境外服务器租用,企业所得税25%怎么计算,查域名ipSpring配置文件中关于事务配置总是由三个组成部分#xff0c;分别是DataSource、TransactionManager和代理机制这三部分#xff0c;无论哪种配置方式#xff0c;一般变化的只是代理机制这部分。 DataSource、TransactionManager这两部分只是会根据数据访问方式有所变化… Spring配置文件中关于事务配置总是由三个组成部分分别是DataSource、TransactionManager和代理机制这三部分无论哪种配置方式一般变化的只是代理机制这部分。  DataSource、TransactionManager这两部分只是会根据数据访问方式有所变化比如使用Hibernate进行数据访问时DataSource实际为SessionFactoryTransactionManager的实现为HibernateTransactionManager。  具体如下图    根据代理机制的不同总结了五种Spring事务的配置方式配置文件如下 第一种方式每个Bean都有一个代理 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:aophttp://www.springframework.org/schema/aopxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsdbean idsessionFactory classorg.springframework.orm.hibernate3.LocalSessionFactoryBean property nameconfigLocation valueclasspath:hibernate.cfg.xml / property nameconfigurationClass valueorg.hibernate.cfg.AnnotationConfiguration //bean !-- 定义事务管理器声明式的事务 -- bean idtransactionManagerclassorg.springframework.orm.hibernate3.HibernateTransactionManagerproperty namesessionFactory refsessionFactory //bean!-- 配置DAO --bean iduserDaoTarget classcom.bluesky.spring.dao.UserDaoImplproperty namesessionFactory refsessionFactory //beanbean iduserDao classorg.springframework.transaction.interceptor.TransactionProxyFactoryBean !-- 配置事务管理器 -- property nametransactionManager reftransactionManager / property nametarget refuserDaoTarget / property nameproxyInterfaces valuecom.bluesky.spring.dao.GeneratorDao /!-- 配置事务属性 -- property nametransactionAttributes props prop key*PROPAGATION_REQUIRED/prop/props /property /bean /beans 第二种方式所有Bean共享一个代理基类 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:aophttp://www.springframework.org/schema/aopxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsdbean idsessionFactory classorg.springframework.orm.hibernate3.LocalSessionFactoryBean property nameconfigLocation valueclasspath:hibernate.cfg.xml / property nameconfigurationClass valueorg.hibernate.cfg.AnnotationConfiguration //bean !-- 定义事务管理器声明式的事务 -- bean idtransactionManagerclassorg.springframework.orm.hibernate3.HibernateTransactionManagerproperty namesessionFactory refsessionFactory //beanbean idtransactionBase classorg.springframework.transaction.interceptor.TransactionProxyFactoryBean lazy-inittrue abstracttrue !-- 配置事务管理器 -- property nametransactionManager reftransactionManager / !-- 配置事务属性 -- property nametransactionAttributes props prop key*PROPAGATION_REQUIRED/prop /props /property /bean !-- 配置DAO --bean iduserDaoTarget classcom.bluesky.spring.dao.UserDaoImplproperty namesessionFactory refsessionFactory //beanbean iduserDao parenttransactionBase property nametarget refuserDaoTarget / /bean /beans 第三种方式使用拦截器 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:aophttp://www.springframework.org/schema/aopxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsdbean idsessionFactory classorg.springframework.orm.hibernate3.LocalSessionFactoryBean property nameconfigLocation valueclasspath:hibernate.cfg.xml / property nameconfigurationClass valueorg.hibernate.cfg.AnnotationConfiguration //bean !-- 定义事务管理器声明式的事务 -- bean idtransactionManagerclassorg.springframework.orm.hibernate3.HibernateTransactionManagerproperty namesessionFactory refsessionFactory //bean bean idtransactionInterceptor classorg.springframework.transaction.interceptor.TransactionInterceptor property nametransactionManager reftransactionManager / !-- 配置事务属性 -- property nametransactionAttributes props prop key*PROPAGATION_REQUIRED/prop /props /property /beanbean classorg.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator property namebeanNames list value*Dao/value/list /property property nameinterceptorNames list valuetransactionInterceptor/value /list /property /bean !-- 配置DAO --bean iduserDao classcom.bluesky.spring.dao.UserDaoImplproperty namesessionFactory refsessionFactory //bean /beans 第四种方式使用tx标签配置的拦截器 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:aophttp://www.springframework.org/schema/aopxmlns:txhttp://www.springframework.org/schema/txxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsdcontext:annotation-config /context:component-scan base-packagecom.bluesky /bean idsessionFactory classorg.springframework.orm.hibernate3.LocalSessionFactoryBean property nameconfigLocation valueclasspath:hibernate.cfg.xml / property nameconfigurationClass valueorg.hibernate.cfg.AnnotationConfiguration //bean !-- 定义事务管理器声明式的事务 -- bean idtransactionManagerclassorg.springframework.orm.hibernate3.HibernateTransactionManagerproperty namesessionFactory refsessionFactory //beantx:advice idtxAdvice transaction-managertransactionManagertx:attributestx:method name* propagationREQUIRED //tx:attributes/tx:adviceaop:configaop:pointcut idinterceptorPointCutsexpressionexecution(* com.bluesky.spring.dao.*.*(..)) /aop:advisor advice-reftxAdvicepointcut-refinterceptorPointCuts / /aop:config /beans 第五种方式全注解 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:aophttp://www.springframework.org/schema/aopxmlns:txhttp://www.springframework.org/schema/txxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsdcontext:annotation-config /context:component-scan base-packagecom.bluesky /tx:annotation-driven transaction-managertransactionManager/bean idsessionFactory classorg.springframework.orm.hibernate3.LocalSessionFactoryBean property nameconfigLocation valueclasspath:hibernate.cfg.xml / property nameconfigurationClass valueorg.hibernate.cfg.AnnotationConfiguration //bean !-- 定义事务管理器声明式的事务 -- bean idtransactionManagerclassorg.springframework.orm.hibernate3.HibernateTransactionManagerproperty namesessionFactory refsessionFactory //bean/beans 此时在DAO上需加上Transactional注解如下 package com.bluesky.spring.dao;import java.util.List;import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import org.springframework.stereotype.Component;import com.bluesky.spring.domain.User;Transactional Component(userDao) public class UserDaoImpl extends HibernateDaoSupport implements UserDao {public ListUser listUsers() {return this.getSession().createQuery(from User).list();}}  转载于:https://www.cnblogs.com/gy19920604/p/5288613.html
http://www.yutouwan.com/news/443827/

相关文章:

  • 阿里网站服务器wordpress 百万级数据
  • node.js做直播网站卖设备用哪个网站
  • 成都程序员网站wordpress登陆logo
  • 建英语网站首页做网站的是不是程序员
  • 兼职网站部门网站建设工作总结
  • 北京公司网站建专业简历模板
  • 沈阳网站制作服务哈尔滨住房建设发展集团网站
  • 北京网站如何制作人性本私 wordpress
  • 昆明网站推广咨询平台建设网站需要的软硬件
  • 沧州网站建设制作网站备案时间要多久
  • 做思维导图的资源网站海门市建设局网站
  • 成都建设银行合作装修网站万网封停慧聪事件最后怎么处理了
  • 洛阳网站开发目前做哪个网站致富
  • 响应式网站建设多少钱帝国cms漏洞
  • 企业网站的重要性工业互联网六大应用场景
  • 找人做app网站吗建筑设计软件免费
  • 崇州市网站建设郑州团购网站建设
  • 成都网站建设套餐wordpress网站打开很慢
  • 响应试网站和移动端教育培训手机网站模板下载
  • 网站如何做360优化加强门户网站建设与管理
  • 网站建设与管理常用wordpress如何配置opcache
  • 抽奖小程序怎么样做免费的百度seo
  • 南宁企业如何建网站沧州商城网站开发设计
  • 网站开发文件结构组成学者网学科建设网站
  • 实力网站建设电话常州建设工程质量监督网站
  • 辽宁省住房城乡建设厅网站代理注册公司服务
  • 建站长沙长春兼职
  • 千博网站建设北京邮电大学电子工程学院研招网
  • 网站qq聊天代码宽带网络哪家好
  • 做网站公司汉狮网络网页设计网站思路