Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChainedTransactionManager does not work with latest spring [DATACMNS-803] #1266

Closed
spring-projects-issues opened this issue Jan 20, 2016 · 7 comments
Assignees
Labels
in: core status: declined type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jan 20, 2016

Murali Mohan Rath opened DATACMNS-803 and commented

A chained transaction manager with a JpaTransactionManager and a JmsTransactionManager does not work with spring boot 1.3.1 but it works with spring boot 1.2.6. This is more to do with spring version change than spring boot itself. I have attached a sample project which demonstrates the issue.

In the attached project, if spring boot version is changed from 1.3.1 to 1.2.6 the transactional method com.example.MyComponent#createRecord completed successfully. But with 1.3.1 it does not.

It might be related to the changes done for https://jira.spring.io/browse/SPR-13243


Affects: 1.11.2 (Gosling SR2)

Attachments:

Issue Links:

  • SPR-14371 Shared EntityManager's target lookup doesn't work with Spring Data's ChainedTransactionManager

1 votes, 2 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 20, 2016

Murali Mohan Rath commented

I think this could also be related to https://jira.spring.io/browse/SPR-13838. The JmsTransactionManager(1st one to commit or rollback) is setting actualTransactiveActive to false and thus JpaTransactionManager breaks

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 20, 2016

Murali Mohan Rath commented

I had another go with spring 4.3.0-BUILD-SNAPSHOT and it works. However I still think it probably needs improvement

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 21, 2016

Oliver Drotbohm commented

I played with the example provided and observed the following:

  • mvn clean test fails to run due to the app not being able to connect to a broker
  • The configuration class looked suspicious as it bootstraps the broker in an @PostConstruct method. I rather turned that into an @Bean method to create the broke, keep an instance and properly shut it down on in an @PreDestroy method of that very configuration class.
  • The test case then executes fine.
  • I autowired MyComponent into the test case and called createRecord(), it still succeeds.
  • Simply running the application also works and I see multiple entities created one after another.

Would you mind altering the example to produce a test case that fails and basically shows what you refer to as "not working"? It's not entirely clear from your description above

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 2, 2016

Murali Mohan Rath commented

Thanks for having a look @Oliver. I have changed the example a bit (see https://jira.spring.io/secure/attachment/23280/chained-transaction-issue-2.zip). It now has one failing test case.

If I change the ChainedTransactionManager to have JpaTransactionManager after Jms one, then the test passes

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 20, 2016

Oliver Drotbohm commented

I can see this working when I upgrade to a recent Boot (1.3.5, pulling in Spring Framework 4.2.6). Also manually upgrading to Spring Framework to that version or even 4.3.0 makes the test case work

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 8, 2016

Murali Mohan Rath commented

Hi Oliver, With the latest spring it works. So I am happy for it to be closed

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2019

Mark Paluch commented

Closing as per comment

@spring-projects-issues spring-projects-issues added type: bug status: declined in: core labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: declined type: bug
Projects
None yet
Development

No branches or pull requests

2 participants