Spring Getting Started (a) transaction spring configuration file in SSH

Source: Internet
Author: User
Tags abstract aop xmlns ssh
<?xml version= "1.0" encoding= "UTF-8"?> <beans "xmlns=" xmlns: aop= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP" xmlns:tx= "Http://www.springframework.org/schema/tx" xmlns:xsi= "    
           Http://www.w3.org/2001/XMLSchema-instance "xsi:schemalocation=" Http://www.springframework.org/schema/beans    
           Http://www.springframework.org/schema/beans/spring-beans.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP Http://www.springframework.org/schema/aop/spring-aop.xsd Http://www.springframework.org/sche 
    Ma/tx http://www.springframework.org/schema/tx/spring-tx.xsd "> <!--database connection data source-->
        <bean id= "DataSource" class= "Org.apache.commons.dbcp.BasicDataSource" > <!--database connection driver--> <property name= "Driverclassname" value= "${jdbc.driverclassname}"/> <!--connected username--> &L T;property name= "username" vaLue= "${jdbc.username}"/> <!--connected user password--> <property name= "password" value= "${jdbc.passwo" RD} "/> <!--connection URL address--> <property name=" url "value=" ${jdbc.url} "/> An> <!--sessionfactory factory--> <bean id= "Localsessionfactorybean" O   Rg.springframework.orm.hibernate3.LocalSessionFactoryBean "> <property name=" dataSource "ref=" DataSource " /> <property name= "mappingresources" > <array> &LT;VALUE&G T;www/csdn/spring/demo/domain/admins.hbm.xml</value> <value>www/csdn/spring/demo/domain/at    
                Users.hbm.xml</value> <value>www/csdn/spring/demo/domain/Collctions.hbm.xml</value> <value>www/csdn/spring/demo/domain/Comments.hbm.xml</value> <value& gt;www/csdn/spring/demo/Domain/messages.hbm.xml</value> <value>www/csdn/spring/demo/domain/pictures.hbm.xml</va    
                Lue> <value>www/csdn/spring/demo/domain/PrivateLetter.hbm.xml</value> <value>www/csdn/spring/demo/domain/Relation.hbm.xml</value> <value>www/csdn/sprin G/demo/domain/userinfo.hbm.xml</value> <value>www/csdn/spring/demo/domain/users.hbm.xml&lt ;/value> </array> </property> <property name= "Hibernatepropertie    
                S "> <props> <prop key=" Hibernate.show_sql ">true</prop>    
                <prop key= "Hibernate.query.factory_class" >org.hibernate.hql.ast.astquerytranslatorfactory </prop> <prop key= "Hibernate.dialect" >org.hibernate.dialect.oracle9dialect</prop&    
            Gt </props> </property> </bean> <!--configuration Hibernatetemplate--> ; Bean id= "hibernatetemplate" class= "org.springframework.orm.hibernate3.HibernateTemplate" > <property nam  E= "Sessionfactory" ref= "Localsessionfactorybean"/> </bean> <!--implement Hibernatedaosupport abstract interface to use --> <bean id= "Hibernatedaosupport" class= "Org.springframework.orm.hibernate3.support.HibernateDaoSuppor" T "abstract=" true "> <property name=" hibernatetemplate "ref=" Hibernatetemplate "/> &L T;/bean> <!--Create Hibernate transaction manager--> <bean id= "Hibernatetransactionmanager" Org.springframework.orm.hibernate3.HibernateTransactionManager "> <property name=" sessionfactory "ref=" Lo Calsessionfactorybean "/> </bean> <!--transaction notification--> <tx:advice id=" Txadvice "transacti On-manager= "HibernatetraNsactionmanager "> <!--transaction properties--> <tx:attributes> <!--transaction Implementation method--&G
            T <tx:method name= "save*" propagation= "REQUIRED" isolation= "DEFAULT"/> <tx:method "name=" propagation= "REQUIRED" isolation= "DEFAULT"/> <tx:method name= "get*" propagation= "REQUIRED" Isolati    
    on= "DEFAULT" read-only= "true"/> </tx:attributes> </tx:advice> <!--section--> <aop:config> <aop:pointcut expression= "Execution (* *.
            Service.*.* (..)) " Id= "Mycut"/> <aop:advisor advice-ref= "Txadvice" pointcut-ref= "Mycut"/>    
        
; </beans>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.