Task doesn't use transaction manager on startup
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
This could be intended behavior, but when an spring cloud task is starting up, it doesn't use the transaction manager when initializing the execution.
Take as an example spring-cloud-task-samples/multiple-datasources. If we change the secondDataSource to disable autocommit, the application will immediately fail on startup because the creation of the execution will be rolled back immediately. after creating it.
@Bean
public DataSource secondDataSource() throws SQLException {
DataSource ds = new EmbeddedDatabaseBuilder()
.setType(EmbeddedDatabaseType.H2)
.build();
SimpleDriverDataSource sdds = ds.unwrap(SimpleDriverDataSource.class);
Properties properties = new Properties();
properties.setProperty("autoCommit", "false");
sdds.setConnectionProperties(properties);
return ds;
}
So either all the initialization code should get wrapped in transaction(s), or the documentation should be updated to reflect that you only support data sources with auto-commit set to true.
- Dominant language
- Java
- Stars
- 446
- Forks
- 310
- Avg merge
- 18h 18m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spring-cloud/spring-cloud-task
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
spring-cloud/spring-cloud-task#954 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
spring-cloud/spring-cloud-task#953 · 1 comment ·
-
status: waiting-on-feedback
Difficulty 4/5 3-5 days Newbie friendliness 25/100
spring-cloud/spring-cloud-task#952 · 2 comments ·
-
App is failing with 'taskLifecycleListener' bean initialization errors post Spring Boot 3.x upgrade Openstatus: waiting-on-feedback
Difficulty 5/5 Over a week Newbie friendliness 15/100
spring-cloud/spring-cloud-task#950 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in spring-cloud/spring-cloud-task
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100