Spring2 配置Hibernate3 thread事务注意事项

Spring2 配置Hibernate3 thread事务注意事项

最容易出错的地方就是配置切入点的时候,配置表达式错误,导致不能正确地绑定事务,会出现提示当前线程未绑定事务和不支持非事务操作错误等。

最好还是用hibernate.cfg.xml,这样就可以以最通用的方式配置hibernate,不置于在Spring使用默生的参数。
 
配置事务时不使用注解,这样就算是要改一些事务配置也不致于要重新编译一遍源码。

你可能感兴趣的:(Spring2 配置Hibernate3 thread事务注意事项)