Fix Application.java
This commit is contained in:
parent
665afc028e
commit
d8cd30d0fd
@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
|
||||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||||
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
|
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
@ -23,8 +22,6 @@ public class Application {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private Environment environment;
|
private Environment environment;
|
||||||
|
|
||||||
private DataSource dataSource;
|
|
||||||
|
|
||||||
public DataSource dataSource() {
|
public DataSource dataSource() {
|
||||||
DriverManagerDataSource dataSource = new DriverManagerDataSource();
|
DriverManagerDataSource dataSource = new DriverManagerDataSource();
|
||||||
|
|
||||||
@ -40,10 +37,6 @@ public class Application {
|
|||||||
return new TransactionAwareDataSourceProxy(dataSource());
|
return new TransactionAwareDataSourceProxy(dataSource());
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataSourceTransactionManager transactionManager() {
|
|
||||||
return new DataSourceTransactionManager(dataSource);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public DataSourceConnectionProvider connectionProvider() {
|
public DataSourceConnectionProvider connectionProvider() {
|
||||||
return new DataSourceConnectionProvider(transactionAwareDataSource());
|
return new DataSourceConnectionProvider(transactionAwareDataSource());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user