yinjihuan / sharding-jdbc Goto Github PK
View Code? Open in Web Editor NEWsharding-jdbc 分库分表示例
sharding-jdbc 分库分表示例
查询条件是 string 类型的查询不出来数据,其实数据库是有的,单独去库查,能查到,同一个字段,数据库值跟查询条件换成数字类型就行查出来,查询条件是字符串就差不赖结果?请问 遇到过这样的问题吗?
_2021-01-15 17:25:58.809 INFO 309564 --- [http-nio-8084-exec-2] ShardingSphere-SQL : Actual SQL: ds0 ::: SELECT u. FROM user_0 u WHERE
u.name=? ::: ["www"]_*
2021-01-15 17:25:58.809 INFO 309564 --- [http-nio-8084-exec-2] ShardingSphere-SQL : Actual SQL: ds0 ::: SELECT u.* FROM user_1 u WHERE
u.name=? ::: ["www"]
2021-01-15 17:25:58.809 INFO 309564 --- [http-nio-8084-exec-2] ShardingSphere-SQL : Actual SQL: ds0 ::: SELECT u.* FROM user_2 u WHERE
u.name=? ::: ["www"]
2021-01-15 17:25:58.809 INFO 309564 --- [http-nio-8084-exec-2] ShardingSphere-SQL : Actual SQL: ds1 ::: SELECT u.* FROM user_0 u WHERE
u.name=? ::: ["www"]
2021-01-15 17:25:58.810 INFO 309564 --- [http-nio-8084-exec-2] ShardingSphere-SQL : Actual SQL: ds1 ::: SELECT u.* FROM user_1 u WHERE
u.name=? ::: ["www"]
2021-01-15 17:25:58.810 INFO 309564 --- [http-nio-8084-exec-2] ShardingSphere-SQL : Actual SQL: ds1 ::: SELECT u.* FROM user_2 u WHERE
u.name=? ::: ["www"]
大哥,我拿你demo搞的,我发现sharding-jdbc-spring-boot-starter的版本差别很大啊,4.0.0-RC1版本的复合分片策略的between and这个不能使用,我看了源码,是bug来的,4.0.0-RC2修复了这bug,但直接项目起不来了,说注解找不到, 你试试。太坑了
可以只分库不分表吗
A 表是业务表 B 是水平分表
select * from A a where a.id in (select id from B where id = 'xxx')
sjdbc-sharding-table-springboot这个模块,只分表不分库的这个,mapper里添加delete方法,运行报错,找不到user表,select,update,insert都可以就delete不行
2020-03-27 18:30:42.768 ERROR 26972 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to [Ljava.lang.Object;
at org.springframework.boot.context.properties.EnableConfigurationPropertiesImportSelector$ConfigurationPropertiesBeanRegistrar.lambda$collectClasses$1(EnableConfigurationPropertiesImportSelector.java:83) ~[spring-boot-2.0.6.RELEASE.jar:2.0.6.RELEASE]
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267) ~[na:1.8.0_112]
大佬,麻烦问下sharding-jdbc单库分表的事物你是怎么处理的?有用到xa事物么?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.