transactional

Transactional saves without calling update method

帅比萌擦擦* 提交于 2019-11-26 09:28:46
问题 I have a method annotated with @Transactional. I retrieve an object from my Oracle DB, change a field, and then return from the method. I forgot to save the object, but discovered that the database gets updated anyway. applicationContext <tx:annotation-driven /> <bean id=\"transactionManager\" class=\"org.springframework.orm.hibernate3.HibernateTransactionManager\"> <property name=\"sessionFactory\" ref=\"sessionFactory\" /> </bean> my method @Transactional public void myMethod(long id) {

Spring @Transactional not working

老子叫甜甜 提交于 2019-11-26 06:31:51
问题 I previously had a post on this issue that was resolved. However since rebuilding the project with auto wired beans and less XML configuration I find I am revisiting this issue. I have followed the way my previous project implemented this but it doesn\'t work. Can someone help me with why or what I should change to make it work? I am on purpose using a non existent table name in the insert user details method to deliberately throw an exception. However the statements for insert user and

Why we shouldn&#39;t make a Spring MVC controller @Transactional?

依然范特西╮ 提交于 2019-11-26 05:18:43
问题 There are already a few questions about the topic, but no response at all really provides arguments in order to explain why we shouldn\'t make a Spring MVC controller Transactional . See: Transaction not working correctly - Spring/MyBatis For web MVC Spring app should @Transactional go on controller or service? Making Spring 3 MVC controller method Transactional Spring MVC Controller Transactional So, why? Is there insurmountable technical issues? Is there architectural issues? Is there

Spring - @Transactional - What happens in background?

北慕城南 提交于 2019-11-25 23:36:03
问题 I want to know what actually happens when you annotate a method with @Transactional ? Of course, I know that Spring will wrap that method in a Transaction. But, I have the following doubts: I heard that Spring creates a proxy class ? Can someone explain this in more depth . What actually resides in that proxy class? What happens to the actual class? And how can I see Spring\'s created proxied class I also read in Spring docs that: Note: Since this mechanism is based on proxies, only \