Saving JPA entity not working in JavaDelegate

We could solve the problem very easily.

We had two configurations for the datasource, an application.yaml and also a @Config Spring class (including a transaction manager), see the code below. As soon as we deleted the @Config, everything was working.

Here is the @Config we now deleted (shortened):

@Configuration
public class Config {

  @Bean public PlatformTransactionManager transactionManager() {
    return new DataSourceTransactionManager(dataSource());
  }

  @Bean public DataSource dataSource() {
    // ... return a new SimpleDriverDataSource
  }

}

And here is the application.yaml that we kept (shortened):

camunda.bpm:
  database:
    type: mysql

spring.jpa:
  properties.hibernate.dialect: org.hibernate.dialect.MySQL5Dialect
  hibernate.ddl-auto: update 

spring.datasource:
  url: jdbc:mysql://xxx/xxx
  username: xxx
  password: xxx
  driver-class-name: com.mysql.jdbc.Driver
2 Likes