apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.95k stars 6.74k forks source link

use master-slave and encrypt rule together #3511

Closed junwangit closed 4 years ago

junwangit commented 5 years ago

Question

Development environment

SpringCloud G+ mybatis-plus 3 .1 + sharding-jdbc 4.0.0 RC3 + hikariCP 3.4.1

When I only configuremaster-slave, it can be used normally. However, I will have problems adding encrypt rule at the same time.

Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

I suspect that there is a problem with the data source initialization order, causing myabtis to fail to get the data source.

Maijh97 commented 5 years ago

I also ran into this problem. It's strange that there was an error in configuring the master slave. I used the Druid data source

junwangit commented 5 years ago

Remove springboot auto-configuration, manually configured, this problem is solved, but new problems arise.

org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column 'updated_time' from result set. Cause: java.sql.SQLFeatureNotSupportedException: getObject with type ; getObject with type; nested exception is java.sql.SQLFeatureNotSupportedException: getObject with type Unit test execution insertion, data can be written desensitized through the main library. However, I got an error when I queried from the library. When the original data source is not configured with the desensitization rule, it can be queried normally. The time of the desensitization rule JDK8 cannot be converted.

terrymanu commented 5 years ago

@junwangit Can you change the title as a whole sentence and to make it for search friendly?

Maijh97 commented 5 years ago

@junwangit Would you like to delete the automatic configuration of mybatis? Or? Is it convenient to provide the sample code?

terrymanu commented 4 years ago

Will colse soon if no response anymore.

junwangit commented 4 years ago

@junwangit Would you like to delete the automatic configuration of mybatis? Or? Is it convenient to provide the sample code?

I use JAVA configuration, it can be used normally.Spring boot automation configuration for the time being do not know what is the reason。

junwangit commented 4 years ago

Will colse soon if no response anymore.

Ok, please close it.