Our project using two DataSource, So we're using AbstractRoutingDataSource + AOP to switch dataSource before application service method invoked. Service like:

@Service
public class AServiceImpl implements AService {
    @Autowired private JdbcTemplate jdbcTemplate;

    // Business method here...
}

This method works fine under tradinally running way.

But while we try to compile to executable with spring aot + graalvm, we found AOP works fine(logger shows that datasource keys changed), but in the service, Datasource doesn't changing: It's always running under the default one.

Anyone knows how to fix it?

run as native executable.

0

There are 0 best solutions below