Spring Boot + Spring Session JDBC Mehrere Datenquellen @SpringSessionDataSource ist ungültigJava

Java-Forum
Anonymous
 Spring Boot + Spring Session JDBC Mehrere Datenquellen @SpringSessionDataSource ist ungültig

Post by Anonymous »

Ich habe ein Problem gefunden, aber ich weiß nicht, wie ich es lösen soll. Wenn die Datenquelle im Interceptor umgeschaltet ist, wird die Sitzung mit dem Kontext ausgeführt, was dazu führt, dass die Struktur der Sitzungsdatenbanktabelle nicht möglich ist. Ich weiß nicht, was es verursacht hat. Es kann eine Transaktion sein. Ich habe die Datenquelle über @SpringSessionDataSource angegeben, aber das geschah immer noch. Was soll ich tun? In der offiziellen Dokumentation der Frühjahrssitzung werden benutzerdefinierte Transaktionen bereitgestellt, aber ich weiß nicht, wie sie implementiert werden sollen. < /P>

Code: Select all

@Primary
@Bean
@SpringSessionDataSource
public DataSource dataSource(List providers) {
DynamicRoutingDataSource dataSource = new DynamicRoutingDataSource(providers);
dataSource.setPrimary(properties.getPrimary());
dataSource.setStrict(properties.getStrict());
dataSource.setStrategy(properties.getStrategy());
dataSource.setP6spy(properties.getP6spy());
dataSource.setSeata(properties.getSeata());
return dataSource;
}

@Bean("springSessionTransactionOperations")
public TransactionOperations springSessionTransactionOperations() {
return TransactionOperations.withoutTransaction();
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post