transaction method « Transaction « Spring Q&A





1. Understanding Spring transactions - What happens when a transactional method calls another transactional method?    stackoverflow.com

Just to understand the workings of Spring transactions I want to know what happens in the following case where one method marked as @Transactional calls another method marked as @Transactional. Assume a ...

2. @Transactional method called from another method doesn't obtain a transaction    stackoverflow.com

In Spring, a method that is annotated with @Transactional will obtain a new transaction if there isn't one already, but I noticed that a transactional method does not obtain any ...

3. @Transactional method calling another method without @Transactional anotation?    stackoverflow.com

I've seen a method in a Service class that was marked as @Transactional but it was also calling some other methods in that same class which were not marked as @Transactional. Does ...

4. Indirect Hibernate/JPA method call loses transaction    stackoverflow.com

I'm using Spring/JPA2/hibernate with this code:

class A {
  @Autowired
  B b;

  @RequestMapping("/test")
  public void test(final HttpServletRequest r1, HttpServletResponse r2) throws ... {

    b.inner();  ...

5. Executing code before and after @Transactional method    stackoverflow.com

We have a Spring based application with a service layer which is annotated with @Transactional. We need to have code run before and after some transactional methods for the following reasons:

  1. We ...

6. Spring @Transactional how to attach different method to same transaction    stackoverflow.com

I have a problem with the transactional configuration subclassing. I have a class A that has this method:

@Override
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public EventMessage<ModificaOperativitaRapporto> activate(EventMessage<ModificaOperativitaRapporto> eventMessage) {
// ...

7. Spring @Transactional persist method not working    stackoverflow.com

I have a Spring MVC sample application it uses UserDaoImpl class to save a User type object to database. Following is the UserDaoImpl code.

public class UserDaoImpl implements UserDao<User> {

private EntityManagerFactory emf;

@PersistenceContext
private ...

8. Transactional saves without calling update method    stackoverflow.com

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 ...

9. Should parent class methods run in transaction?    forum.springsource.org

If a child class is annotated with @Transactional, should the methods in the parent class also run in a transaction when the parent class methods are called directly (on an instance ...





10. init-method comes before @Transactional    forum.springsource.org

init-method comes before @Transactional Hey there, I have a class with a public @Transactional method which loads some values from the DB. I'm declaring the bean in the xml with the ...

11. @Transactional method : transaction not propagated : individual commits    forum.springsource.org

@Transactional method : transaction not propagated : individual commits Using Spring 3 + hibernate3 + c3p0 and hibernate transaction manager. In the below I expect the data to be deleted and ...

12. Need same transaction for two methods    forum.springsource.org

Hai all In my interfacedao call i am having two methods saveMaster()--Saves the masterpage saveDetail()---saves the detailpage I need to give the transaction to this methods,THe problem is both the methods ...

13. Transactional init-method    forum.springsource.org

Transactional init-method Hi, I have a transactional bean composed of a target (beanTarget) and a service (beanService) that adds the transactional aspect (using TransactionProxyFactoryBean). There's an init-method in the target bean ...

14. Transaction always created, even when method marked with SUPPORTS    forum.springsource.org

[RESOLVED] Transaction always created, even when method marked with SUPPORTS Hi folks, In recent performance profiling I've found that one of the last remaining squeaky wheels is an ApplicationListener.onApplicationEvent() method in ...

15. I Want Instance-level not Method-level Transactions    forum.springsource.org

I Want Instance-level not Method-level Transactions I'm using Spring with Hibernate with an application-ctx of: Code: ...

16. transaction, different methods - what happens?    forum.springsource.org

transaction, different methods - what happens? Hi there, I have a question about the aspect transaction mechanismen in spring: I'm using JdbcDaoSupport and the org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean wrapper. I define the following ...





17. method and its embed method transaction control    forum.springsource.org

method and its embed method transaction control methodA() contains methodE(). Both methods use Hibernate DAO to access/update database. void methodA(){ ... methodE(); .. } My goal is methodA() can commit whatever ...

18. Cross-method transactions    forum.springsource.org

Cross-method transactions Hello! I have a unique problem and was wondering if Spring may be able to provide an elegant solution. Here is my problem: I have a complex domain model ...

19. exclude method from being in a transaction    forum.springsource.org

exclude method from being in a transaction Hi, In the spring config, i have configured a class with all methods as propogation required, however i need to exclude some methods from ...

20. Weirds behavior of persist method with @Transactional    forum.springsource.org

Weirds behavior of persist method with @Transactional Hello all! I've had this problem for a couple of days: When i save two objects in one transactional method and the second one ...

21. @Transactional only on public methods?    forum.springsource.org

The @Transactional annotation seems like such a great idea, but I'm curious to know why it's only allowed on public methods. Is this an artifical limitation? Are there any plans to ...

22. Calling one transactional method from another    forum.springsource.org

Calling one transactional method from another Hello All! I have a probably dumb question about transactions: If I have something like this in my app context: Code:

23. @Transactional on non-interface methods    forum.springsource.org

@Transactional on non-interface methods Hi, We are using Spring with iBATIS. Requirement: We have two entities with parent, child relationship. We have an interface and implementation to create these entities. Following ...

24. @Transactional default on non transactional methods    forum.springsource.org

@Transactional default on non transactional methods Hi, I'm moving from Spring 1.x declarative transaction style to @Transactional style. I have the feeling that this gives me a lesser fine grained control ...

25. Execute method before @Transactional    forum.springsource.org

If I correctly understand what you are trying to do, I think you should be able to use Before advice, unless you need to perform some processing after the target method ...

26. How to implement METHOD level transaction    forum.springsource.org

How to implement METHOD level transaction Hi All, I want to implement a method level transaction using @Transactional annotation. SCENARIO: ---------- I'm calling a transactional method in the same class and ...

27. transaction declaration and "inner" methods    forum.springsource.org

transaction declaration and "inner" methods Hi. Encountered the following problem. Example: public class fooImpl - public fooBar() - public foo() fooImpl and its interface is wired up through spring. foo() is ...

28. Disable transaction for a specific method?    forum.springsource.org

29. Why @Transaction doesn't work with a custom method on DispatchAction?    forum.springsource.org

Jan 4th, 2008, 02:20 PM #1 leozin View Profile View Forum Posts Private Message Junior Member Join Date Oct 2007 Posts 4 Why @Transaction doesn't work with a custom method on ...

30. Issues with methods calling methods with @Transactional    forum.springsource.org

Issues with methods calling methods with @Transactional I am having issues when a method calls a method with the @Transactional. When I do, it appears to be ignored. The scenario I ...

31. Transaction issue with methods overlap    forum.springsource.org

Transaction issue with methods overlap Hello everybody, We have a problem to define a transaction on a method of a specific object while preserving its dynamic operation. Basically, we have a ...

32. Transaction and methods    forum.springsource.org

Transaction and methods Hi, I was going through the tutorial at: http://static.springframework.org/sp...ansaction.html I would like to know if there's a way to use different set of transaction for different methods on ...

33. @Transactional on Parent Class methods    forum.springsource.org

Is @Transactional Annotation, inherited from Parent Class. I have something like Code: @Transactional public abstract class BaseDAO ... { @Transactional(readOnly=true) public BaseDTO findById(int id); } And a child class @Transactional public ...

34. How to set transaction rollbackOnly with method parameter ?    forum.springsource.org

How to set transaction rollbackOnly with method attribute(sorry, wrong in the thread name)? Is there a way for doing this? My service has several methods, I need one of them to ...

35. Transaction not working for non-action methods [JSF]    forum.springsource.org

Transaction not working for non-action methods [JSF] Hi, I have a JSF application integrated with Spring, with the help of ContextLoaderListener and RequestContextListener (configured inside web.xml). I have configured transactions on ...

36. @Transactional on private methods    forum.springsource.org

Hi, I use the @Transactional annotation (on implementation methods) to mark the boundaries of my services transactions. This is enabled by adding the following to my Spring config file Code:

37. Is this transaction method okay?    forum.springsource.org

Jul 31st, 2008, 11:35 AM #1 Sudheer View Profile View Forum Posts Private Message Junior Member Join Date Mar 2008 Posts 2 Is this transaction method okay? Hello Friends I am ...

38. Spring 2.5 - Transaction not rolling back for two separate method calls    forum.springsource.org

Spring 2.5 - Transaction not rolling back for two separate method calls Trying to rollback the previous write to database using Spring transaction for POC and learning purposes. There are two ...

39. FOLLOW ON: Spring 2.5 - Transaction not rolling back for two separate method calls    forum.springsource.org

Worried that I am trashing all over somebody elses forum entry, so I have created as new. RE: http://forum.springframework.org/new...ote=1&p=194893 If that is the case, what is the point of the REQUIRED ...

40. Transactions only working for init() methods?    forum.springsource.org

Transactions only working for init() methods? I have what appears to be a fairly basic, by-the-book Spring setup for transactions. My problem is no transactions are being created where expected, EXCEPT ...

41. WrappedException not thrown from Transactional method    forum.springsource.org

WrappedException not thrown from Transactional method Hello, I've created a transactional service using the Transacational annotation. Within my service, I have a try/catch which catches any Exception and rewraps it within ...

42. Query on transactions between method calls..?    forum.springsource.org

Query on transactions between method calls..? hi, a query -- My service class has a method M1 and a method M2 ( service class implements interface has only method M2). My ...

43. Reflection on a Transactional method    forum.springsource.org

Reflection on a Transactional method We have a situation where a method annotated Transactional is invoked reflectively using Method.invoke. The transaction is not created - it appears that the pointcut in ...

44. @Transactional methods simulated with inner class    forum.springsource.org

@Transactional methods simulated with inner class I'm sure this is a newbie question, but I have a few methods in a web controller that I want to make transactional, but I ...

45. Transaction being created twice for the same method    forum.springsource.org

Dec 16th, 2008, 12:28 PM #1 yaravind View Profile View Forum Posts Private Message Junior Member Join Date Sep 2007 Posts 13 Transaction being created twice for the same method Helo ...

46. @Transaction to private methods    forum.springsource.org

I added @Transaction to my service class.my service class has private methods , is transaction added to private methods too ? and suppose I have some methods which does not need ...

47. not to create new transaction for some methods    forum.springsource.org

I don't know if it's "right". I would assume a read-only transaction would be lighter-weight than a read-write transaction, but if you really want to avoid creating any transaction at all ...

48. one and the same transaction for 2 methods    forum.springsource.org

one and the same transaction for 2 methods Hello, how to have 2 methods be in the same transaction? And transaction should start before first method, and finish after second. And ...

49. Calling @Transactional method from non-transactional one    forum.springsource.org

Nov 10th, 2009, 03:27 PM #1 pavla novakova View Profile View Forum Posts Private Message Junior Member Join Date Aug 2008 Posts 18 Calling @Transactional method from non-transactional one Hi, I've ...

50. Specifying methods as non-transactional?    forum.springsource.org

I have a service that I am proxying via TransactionProxyFactoryBean: Code: PROPAGATION_REQUIRES_NEW

51. How do I mark a method !@Transactional    forum.springsource.org

Hi, I have a few DAO's which I've defined to be @Transactional at the class level. Is there any way to say "this particular method of this class is NOT @Transactional"? ...

52. Spring transaction management - Trying to execute method in one transaction    forum.springsource.org

Spring transaction management - Trying to execute method in one transaction Hi, everyone. I am new in Spring. I have some problem. I use SimpleJdbcTemplate, which is taken from connection pool. ...

53. Transaction Advice WildCard For a Particular Method    forum.springsource.org

Hi I am using Spring AOP in my application .I have more than 20 methods in a class.I have to apply the following transaction advice for all the methods except for ...

54. Legacy code calling transactional method    forum.springsource.org

Legacy code calling transactional method Hi everyone, I'm facing an issue while moving my application to Spring. I have legacy code using JDBC connection to connect to the database. I cannot ...

55. Help with Spring + Hibernate + Transactional Method    forum.springsource.org

Help with Spring + Hibernate + Transactional Method I create that 2 methods: Code: @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class }) public boolean enviarMensagem(TbMensagem mensagem, List itemMensagemList, List caixaCartorioDestinatarioList, TbUsuario usuario) ...

56. Transactional issue: XAException: The method 'xa_end' has failed with errorCode '100'    forum.springsource.org

Transactional issue: XAException: The method 'xa_end' has failed with errorCode '100' Hey everyone, After endless hours of google'ing and debugging I just can't figure out the solution to a problem I'm ...