spring3.1+hibernate4.1关于事务的配置
来源:互联网 发布:stm8编程手册中文版 编辑:程序博客网 时间:2024/05/16 09:52
spring3.1+hibernate4.1关于事务的配置 --》搞了很久 不过hibernate的更新过快!!!!spring是不是跟不上啊
标签:Hibernate Spring
[1].[代码] spring3.1+hibernate4.1关于事务的配置 跳至 [1]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---注意hibernate4的版本头信息与hibernate3的不同 可能会报错 具体的可以到hibernate核心包下copy
<?xml version=
"1.0"
encoding=
"UTF-8"
?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:p=
"http://www.springframework.org/schema/p"
xmlns:aop=
"http://www.springframework.org/schema/aop"
xmlns:tx=
"http://www.springframework.org/schema/tx"
xsi:schemaLocation="http:
//www.springframework.org/schema/beans
http:
//www.springframework.org/schema/beans/spring-beans-3.1.xsd
http:
//www.springframework.org/schema/aop
http:
//www.springframework.org/schema/aop/spring-aop-3.1.xsd
http:
//www.springframework.org/schema/tx
http:
//www.springframework.org/schema/tx/spring-tx-3.1.xsd
">
<bean id=
"dataSource"
class
=
"com.mchange.v2.c3p0.ComboPooledDataSource"
>
<property name=
"driverClass"
value=
"com.microsoft.sqlserver.jdbc.SQLServerDriver"
>
</property>
<property name=
"jdbcUrl"
value=
"jdbc:sqlserver://localhost:1433;databaseName=FundDb"
>
</property>
<property name=
"user"
value=
"sa"
></property>
<property name=
"password"
value=
"123456"
></property>
</bean>
<bean id=
"sessionFactory"
class
=
"org.springframework.orm.hibernate4.LocalSessionFactoryBean"
>
<property name=
"dataSource"
ref=
"dataSource"
></property>
<property name=
"hibernateProperties"
>
<props>
<prop key=
"hibernate.dialect"
>
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key=
"hibernate.show_sql"
>
true
</prop>
<prop key=
"hibernate.cache.use_second_level_cache"
>
true
</prop>
<prop key=
"hibernate.cache.use_query_cache"
>
true
</prop>
<prop key=
"hibernate.cache.region.factory_class"
>org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
</props>
</property>
<property name=
"mappingResources"
>
<list>
<value>com/entity/Admin.hbm.xml</value>
</list>
</property>
</bean>
<bean id=
"tran"
class
=
"org.springframework.orm.hibernate4.HibernateTransactionManager"
>
<property name=
"sessionFactory"
ref=
"sessionFactory"
></property>
</bean>
<tx:advice id=
"aa"
transaction-manager=
"tran"
>
<tx:attributes>
<tx:method name=
"add*"
propagation=
"REQUIRED"
isolation=
"READ_COMMITTED"
/>
<tx:method name=
"*"
read-only=
"true"
propagation=
"REQUIRED"
/>
</tx:attributes>
</tx:advice>
<aop:config proxy-target-
class
=
"true"
>
<aop:pointcut expression=
"execution(* com.dao.*.addoneadmin(..))"
id=
"my"
/>
<aop:advisor advice-ref=
"aa"
pointcut-ref=
"my"
/>
</aop:config>
<bean id=
"admindao"
class
=
"com.dao.AdminDao"
p:sf-ref=
"sessionFactory"
></bean>
</beans>
0 0
- spring3.1+hibernate4.1关于事务的配置
- springmvc+spring3.1+hibernate4配置事务不起作用
- spring3+hibernate4.1声明式事务
- Hibernate4.1+Spring3.1配置变动
- spring3.1与hibernate4集成配置
- spring3+hibernate4.1声明式事务(1)
- spring3.1+hibernate4
- spring3 hibernate4 事务问题
- MyEclipse 配置SSH (Struts2.1 Spring3.1 Hibernate4.1)
- Struts2.3.4.1+Spring3.2.3+Hibernate4.1.9_配置步骤
- Struts2.3+Spring3.2.8+Hibernate4.1全注解配置
- Struts2.3+Spring3.2.8+Hibernate4.1全注解配置
- Struts2.3+Spring3.2.8+Hibernate4.1全注解配置
- Struts2.3+Spring3.2.8+Hibernate4.1全注解配置
- Spring3.1+Hibernate4.1整合
- spring3.1与hibernate4整合
- spring3.1与hibernate4整合
- spring3.1+struts2+hibernate4整合
- 猜数字游戏
- 开发WebService两种开源工具CXF和Axis2的比较
- jni练习(一)
- PCB layout - PCB设计操作流程和注意事项
- HTML5 原质化设计表单简单实例学习
- spring3.1+hibernate4.1关于事务的配置
- 一场失败的比赛(39届,上海!)
- java类与对象基础总结
- 现实世界中哪些地方用到了Java?
- windows下使用jdbc连接MySQL
- 汇编语言基本指令
- python中的字符串类型
- 金领航三版网站程序总是出问题,如何做个好的程序猿?
- 将 Hibernate 的 HQL 转成最终要执行的 SQL 语句