You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/10 06:32:43 UTC

[GitHub] [shardingsphere] mmcLine opened a new issue, #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

mmcLine opened a new issue, #20614:
URL: https://github.com/apache/shardingsphere/issues/20614

   ### Which version of ShardingSphere did you use?
   
   4.1.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   Read the data immediately after writing, expecting to query from the master database
   ### Actual behavior
   
   query from the slave database
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   service query by slave database:
   
   ![image](https://user-images.githubusercontent.com/37876129/187062373-bfef1ce9-72f8-4d6f-befc-ca03a271c19a.png)
   
   
   ### Example codes for reproduce this issue (such as a github link).
   
   ```
   @Service
   public class CityService {
   
       @Autowired
       private CityRepository cityRepository;
   
       @Autowired
       private CityService2 cityService2;
   
       @Transactional(rollbackFor = Exception.class)
       public void test(){
           City city=new City();
           city.setName("眉山");
           city.setProvince("四川");
           cityRepository.save(city);
   
           cityService2.test();
   
           List<City> all = cityRepository.findAll();
           all.forEach(x->{
               System.out.println("cityService:"+((x.getProvince().equals("四川"))?"主库":"从库")+":"+x);
           });
       }
   }
   ```
   
   ```
   public class CityService2 {
   
       @Autowired
       private CityRepository cityRepository;
   
       @Transactional(propagation = Propagation.REQUIRES_NEW)
       public void test(){
           List<City> all = cityRepository.findAll();
           all.forEach(x->{
               System.err.println("cityService2:"+((x.getProvince().equals("四川"))?"主库":"从库")+":"+x);
           });
       }
   }
   
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #20614:
URL: https://github.com/apache/shardingsphere/issues/20614#issuecomment-1407552525

   Fixed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang closed issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW) 
URL: https://github.com/apache/shardingsphere/issues/20614


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] mmcLine commented on issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by GitBox <gi...@apache.org>.
mmcLine commented on issue #20614:
URL: https://github.com/apache/shardingsphere/issues/20614#issuecomment-1229486487

   > Hi @mmcLine 4.1.0 is too old, can you try the latest 5.1.2?
   
   I tried the latest version, but it's still wrong


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #20614:
URL: https://github.com/apache/shardingsphere/issues/20614#issuecomment-1272348695

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] FlyingZC commented on issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by GitBox <gi...@apache.org>.
FlyingZC commented on issue #20614:
URL: https://github.com/apache/shardingsphere/issues/20614#issuecomment-1229619722

   I want to investigate it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] FlyingZC commented on issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by GitBox <gi...@apache.org>.
FlyingZC commented on issue #20614:
URL: https://github.com/apache/shardingsphere/issues/20614#issuecomment-1286328432

   This bug has been fixed by https://github.com/apache/shardingsphere/pull/20814 .See the reply below this issue #20789.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW) 
URL: https://github.com/apache/shardingsphere/issues/20614


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #20614: Routing problem in the new transcation(propagation = Propagation.REQUIRES_NEW)

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #20614:
URL: https://github.com/apache/shardingsphere/issues/20614#issuecomment-1229406953

   Hi @mmcLine 4.1.0 is too old, can you try the latest 5.1.2?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org