profile
viewpoint
wanglichao 0532 Běi Jīng China http://wanglichao.com :walking: :gun: :raised_hands: :boom: :moneybag: :ambulance: :hospital: :syringe: :skull:

0532/0532.github.com 4

:date: GitHub Page

0532/HT-Contributions 3

Messing with my contributions graph .

0532/Http 3

Http工具类

0532/advanced-java 1

😮 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识,后端同学必看,前端同学也可学习

0532/cywin 1

fork

0532/guava-study 1

https://github.com/google/guava/wiki

0532/guava-userguide-cn 1

guava-libraries 用户指南中文翻译

0532/2018-Java-Interview 0

经历BATJ面试后总结的【高级Java后台开发面试指南】,纯净干货无废话,针对高频面试点

0532/atomJ 0

intelliJ keybindings for Atom

started0532/advanced-java

started time in 7 days

fork 0532/advanced-java

😮 互联网 Java 工程师进阶知识完全扫盲:涵盖高并发、分布式、高可用、微服务、海量数据处理等领域知识,后端同学必看,前端同学也可学习

https://doocs.github.io/advanced-java

fork in 7 days

issue openedredisson/redisson

redissonClient.getTopic重复消费

RTopic topic = redissonClient.getTopic("testExceptionTopic");

        topic.addListener(String.class, new MessageListener<String>() {
            @Override
            public void onMessage(CharSequence charSequence, String calc) {
                if (!lockUtils.acquireLock(calc)){
                    return;
                }
                System.out.println("2onMessage:{}" + charSequence+",calc:{}"+ calc);
            }
        });

集群形式下,多个订阅会重复消费是为什么

created time in a month

issue openedbaomidou/dynamic-datasource-spring-boot-starter

Could not roll back JDBC transaction

Enviroment

JDK Version(required): 1.8 SpringBoot Version(required): 2.1.5 dynamic-datasource-spring-boot-starter Version(required): 3.1.1 druid Version(optional):

Describe

Caused by: org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is java.sql.SQLException: Connection is closed
	at org.springframework.jdbc.datasource.DataSourceTransactionManager.doRollback(DataSourceTransactionManager.java:347)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:838)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:812)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:552)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:299)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at com.baomidou.dynamic.datasource.aop.DynamicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnnotationInterceptor.java:49)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)

Expected Result:

同一数据源下事务回滚

Actual Result:
回滚失败

Steps to reproduce

  • Step 1

  • Step 2

  • Step 3

created time in 2 months

startedresilience4j/resilience4j

started time in 2 months

starteddiracccc/redis-rate-limiter

started time in 2 months

startedknowm/XChange

started time in 2 months

issue openedbaomidou/dynamic-datasource-spring-boot-starter

DS注解未生效

Enviroment

JDK Version(required): 1.8 SpringBoot Version(required): 2.1.5 dynamic-datasource-spring-boot-starter Version(required): 3.1.0 druid Version(optional):

Describe

第一种

    public void testTx(String bizsystem){
        do1(bizsystem);do2(bizsystem);
    }
    @DS("#bizsystem")
    public void do1(String bizsystem){
        RepayQueueEntity applyEntity = new RepayQueueEntity().setStatus(4);
        boolean b = RepayQueueDao.update(applyEntity,
                new LambdaUpdateWrapper<RepayQueueEntity>()
                        .eq(RepayQueueEntity::getApplyNo,"15905889624903818")
                        .eq(RepayQueueEntity::getBizSystem,"JIN")
        );
        System.out.println("1>>>>>>>>>>>>>finish>>>>>>>>>"+b);
    }
    @DS("#bizsystem")
    public void do2(String bizsystem){
        RepayQueueEntity applyEntity = new RepayQueueEntity().setStatus(4);
        boolean b = glcRepayQueueDao.update(applyEntity,
                new LambdaUpdateWrapper<RepayQueueEntity>()
                        .eq(RepayQueueEntity::getApplyNo,"15905771682679568")
                        .eq(RepayQueueEntity::getBizSystem,"JIN")
        );
        System.out.println("2>>>>>>>>>>>>>finish>>>>>>>>>"+b);
    }

第二种:

    @DS("#bizsystem")
    public void testTx(String bizsystem){
        do1(bizsystem);do2(bizsystem);
    }
    public void do1(String bizsystem){
        RepayQueueEntity applyEntity = new RepayQueueEntity().setStatus(4);
        boolean b = RepayQueueDao.update(applyEntity,
                new LambdaUpdateWrapper<RepayQueueEntity>()
                        .eq(RepayQueueEntity::getApplyNo,"15905889624903818")
                        .eq(RepayQueueEntity::getBizSystem,"JIN")
        );
        System.out.println("1>>>>>>>>>>>>>finish>>>>>>>>>"+b);
    }
    public void do2(String bizsystem){
        RepayQueueEntity applyEntity = new RepayQueueEntity().setStatus(4);
        boolean b = glcRepayQueueDao.update(applyEntity,
                new LambdaUpdateWrapper<RepayQueueEntity>()
                        .eq(RepayQueueEntity::getApplyNo,"15905771682679568")
                        .eq(RepayQueueEntity::getBizSystem,"JIN")
        );
        System.out.println("2>>>>>>>>>>>>>finish>>>>>>>>>"+b);
    }

Expected Result:

数据源指定都生效

Actual Result:

都在同一个类下面,应该都是成功的

第一种数据源走默认了 第二种成功了

Steps to reproduce

  • Step 1

  • Step 2

  • Step 3

created time in 2 months

push event0532/0532.github.com

wanglichao

commit sha 7c351959738c83c795b63a599022c93d69fca92e

Update README.md

view details

push time in 2 months

startedhelloworlde/SpringBoot-DynamicDataSource

started time in 2 months

issue commentbaomidou/dynamic-datasource-spring-boot-starter

咨询@DS切换数据源,使用spel返回null

你种写法不对吧

(wiki)[https://github.com/baomidou/dynamic-datasource-spring-boot-starter/wiki/Dynamic-Analysis-DataSource]

xiayz

comment created time in 2 months

issue closedbaomidou/dynamic-datasource-spring-boot-starter

DynamicDataSourceContextHolder.peek为空

Enviroment

JDK Version(required): 1.8

SpringBoot Version(required): 2.1.5

Starter Version(required):3.1.0

Describe

image

测试的时候

    public static String peek() {
        return (String)((Deque)LOOKUP_KEY_HOLDER.get()).peek();
    }

结果为空

Expected Result:

Actual Result:
没有选择传入数据源,走了默认,这里需要手动push一下吗

Steps to reproduce

  • Step 1
@DS("yc")
    private void testDb(String system){
        List<Entity> list = dao.list(system);
        System.out.println("#########"+list.size());
    }
  • Step 2

  • Step 3

closed time in 2 months

0532

issue commentbaomidou/dynamic-datasource-spring-boot-starter

DynamicDataSourceContextHolder.peek为空

嗯 解决了 在程序里没有问题里,可能是测试类配的有问题 @huayanYu 谢谢了 😄

0532

comment created time in 2 months

issue commentbaomidou/dynamic-datasource-spring-boot-starter

多租户场景 是通过filter手动设置DynamicDataSourceContextHolder 的.如果在service层开一个新的线程. 子线程再操作数据库就无法切换数据源.

@0532 看master 改到过NamedInheritableThreadLocal , 但是又改回了 NamedThreadLocal ,不知道为什么

https://github.com/baomidou/dynamic-datasource-spring-boot-starter/issues/200#issue-620640060

可能是这个issue的问题

siaron

comment created time in 3 months

issue commentbaomidou/dynamic-datasource-spring-boot-starter

多租户场景 是通过filter手动设置DynamicDataSourceContextHolder 的.如果在service层开一个新的线程. 子线程再操作数据库就无法切换数据源.

下个版本

hello 这个有开发计划吗 , 或者有开发的分支了吗 ,我们也想用一下这个功能,可以和你一起测一下

siaron

comment created time in 3 months

issue openedbaomidou/dynamic-datasource-spring-boot-starter

DynamicDataSourceContextHolder.peek为空

Enviroment

JDK Version(required): 1.8

SpringBoot Version(required): 2.1.5

Starter Version(required):3.1.0

Describe

image

测试的时候

    public static String peek() {
        return (String)((Deque)LOOKUP_KEY_HOLDER.get()).peek();
    }

结果为空

Expected Result:

Actual Result:

Steps to reproduce

  • Step 1

  • Step 2

  • Step 3

created time in 3 months

fork 0532/CoinExchange

开源数字货币交易所,基于Java开发的比特币交易所 | BTC交易所 | ETH交易所 | 数字货币交易所 | 交易平台 | 撮合交易引擎。本项目基于SpringCloud微服务开发,可用来搭建和二次开发数字货币交易所,有完整的撮合交易引擎源码、后台管理(后端+前端)、前台(交易页面、活动页面、个人中心等)、安卓APP源码、苹果APP源码、币种钱包RPC源码。联系QQ:877070886

fork in 3 months

more