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 2021/11/27 13:39:25 UTC

[GitHub] [shardingsphere] zt9788 opened a new issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

zt9788 opened a new issue #13830:
URL: https://github.com/apache/shardingsphere/issues/13830


   shardingsphere5.0 
   I Create two DataSource use the `ShardingSphereDataSourceFactory.createDataSource`
   set mode=Standalone,File 
   When start programe again that will be load twice pool 
   like:
   fisrt time:
   ```
   //create one
   HikariPool 1...
   HikariPool 2...
   //create two
   HikariPool 3
   HikariPool 4
   ```
   
   When I restart program:
   ```
   //create one
   HikariPool 1
   HikariPool 2
   HikariPool 3
   HikariPool 4
   //create two
   HikariPool 5 ...8
   ```
   I see the `StandaloneContextManagerBuilder` will load MetaData and then to load two dataSource once .
   
   I do not kown ,this is right?


-- 
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] zjcnb commented on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

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


   @zt9788 Nice, I will see


-- 
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] zjcnb commented on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

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


   @zt9788 I think this problem are fixed, refer to : #14137. Can you hava a try?


-- 
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] zt9788 edited a comment on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

Posted by GitBox <gi...@apache.org>.
zt9788 edited a comment on issue #13830:
URL: https://github.com/apache/shardingsphere/issues/13830#issuecomment-997653246


   @zjcnb Is there have SNAPSHOT version?


-- 
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 #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

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


   Hi @zjcnb, can you help take a look at this issue?


-- 
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] zt9788 commented on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

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


   ```
   k=name
   mode = ModeConfiguration(file,standalone)
   v=(master,slave)
   rules=(new ShardingRuleConfigurationYamlSwapper()).swapToObject(YamlReadwriteSplittingRuleConfiguration[from yml])
    ShardingSphereDataSource shardingSphereDataSource =
                           (ShardingSphereDataSource) ShardingSphereDataSourceFactory.createDataSource(
                                   k, mode, v, rules, shardingProps.getProps());
   ```
   
   ![image](https://user-images.githubusercontent.com/15647179/144033060-53cfc633-fb53-436c-80b6-b4e826abbd71.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033133-cefef7a2-4b36-49ca-86bc-b0e5afcbeacf.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033184-ced25c4f-f2a2-48aa-b736-3d45cba60455.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033271-96e3d0e7-fde7-4238-82fb-e34519ac10cd.png)
   dbA-dataSources:
   ```
   xxxxx-master:
     schema: null
     transactionIsolation: null
     exceptionOverrideClassName: null
     initializationFailTimeout: 1
     validationTimeout: 5000
     catalog: null
     maxLifetime: 30000
     leakDetectionThreshold: 0
     connectionInitSql: null
     minimumIdle: 2
     keepaliveTime: 0
     password: xxxxxx
     dataSourceJNDI: null
     connectionTestQuery: null
     idleTimeout: 60000
     driverClassName: com.mysql.cj.jdbc.Driver
     jdbcUrl: xxxxxxxxxxx
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     maximumPoolSize: 100
     connectionTimeout: 60000
     username: hq_db
     poolName: null
   xxxxxx-slave1:
     schema: null
     transactionIsolation: null
     exceptionOverrideClassName: null
     initializationFailTimeout: 1
     validationTimeout: 5000
     catalog: null
     maxLifetime: 30000
     leakDetectionThreshold: 0
     connectionInitSql: null
     minimumIdle: 2
     keepaliveTime: 0
     password: xxxxxxxxx
     dataSourceJNDI: null
     connectionTestQuery: null
     idleTimeout: 60000
     driverClassName: com.mysql.cj.jdbc.Driver
     jdbcUrl: xxxxxxxxxxxx
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     maximumPoolSize: 100
     connectionTimeout: 60000
     username: hq_db
     poolName: null
   
   ````
   
   db2-Datasource :
   Omitted, basically consistent with the above
   
   When progarm restart,here will load all of the datasource of metadata(`StandaloneContextManagerBuilder`)
   ![image](https://user-images.githubusercontent.com/15647179/144033812-508ae24b-2e49-425c-ab1d-cebdcfe20ea1.png)
   


-- 
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] zjcnb commented on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

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


   @strongduanmu Thanks, I will check 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] zjcnb commented on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

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


   @zt9788 Hi, i think it's not a problem. I can't  reproduce it. Can you provider your demo project or show your .shardingsphere file


-- 
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] zt9788 commented on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

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


   @zjcnb It is there have SNAPSHOT version?


-- 
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] zt9788 edited a comment on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

Posted by GitBox <gi...@apache.org>.
zt9788 edited a comment on issue #13830:
URL: https://github.com/apache/shardingsphere/issues/13830#issuecomment-982518384


   @zjcnb  
   I just saw your reply .
   ```
   k=name
   mode = ModeConfiguration(file,standalone)
   v=(master,slave)
   rules=(new ShardingRuleConfigurationYamlSwapper()).swapToObject(YamlReadwriteSplittingRuleConfiguration[from yml])
    ShardingSphereDataSource shardingSphereDataSource =
                           (ShardingSphereDataSource) ShardingSphereDataSourceFactory.createDataSource(
                                   k, mode, v, rules, shardingProps.getProps());
   ```
   
   ![image](https://user-images.githubusercontent.com/15647179/144033060-53cfc633-fb53-436c-80b6-b4e826abbd71.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033133-cefef7a2-4b36-49ca-86bc-b0e5afcbeacf.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033184-ced25c4f-f2a2-48aa-b736-3d45cba60455.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033271-96e3d0e7-fde7-4238-82fb-e34519ac10cd.png)
   dbA-dataSources:
   ```
   xxxxx-master:
     schema: null
     transactionIsolation: null
     exceptionOverrideClassName: null
     initializationFailTimeout: 1
     validationTimeout: 5000
     catalog: null
     maxLifetime: 30000
     leakDetectionThreshold: 0
     connectionInitSql: null
     minimumIdle: 2
     keepaliveTime: 0
     password: xxxxxx
     dataSourceJNDI: null
     connectionTestQuery: null
     idleTimeout: 60000
     driverClassName: com.mysql.cj.jdbc.Driver
     jdbcUrl: xxxxxxxxxxx
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     maximumPoolSize: 100
     connectionTimeout: 60000
     username: xxxxx
     poolName: null
   xxxxxx-slave1:
     schema: null
     transactionIsolation: null
     exceptionOverrideClassName: null
     initializationFailTimeout: 1
     validationTimeout: 5000
     catalog: null
     maxLifetime: 30000
     leakDetectionThreshold: 0
     connectionInitSql: null
     minimumIdle: 2
     keepaliveTime: 0
     password: xxxxxxxxx
     dataSourceJNDI: null
     connectionTestQuery: null
     idleTimeout: 60000
     driverClassName: com.mysql.cj.jdbc.Driver
     jdbcUrl: xxxxxxxxxxxx
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     maximumPoolSize: 100
     connectionTimeout: 60000
     username: xxxxx
     poolName: null
   
   ````
   
   db2-Datasource :
   Omitted, basically consistent with the above
   
   When progarm restart,here will load all of the datasource of metadata(`StandaloneContextManagerBuilder`)
   ![image](https://user-images.githubusercontent.com/15647179/144033812-508ae24b-2e49-425c-ab1d-cebdcfe20ea1.png)
   


-- 
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] zt9788 edited a comment on issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

Posted by GitBox <gi...@apache.org>.
zt9788 edited a comment on issue #13830:
URL: https://github.com/apache/shardingsphere/issues/13830#issuecomment-982518384


   @zjcnb  
   I just saw your reply .
   ```
   k=name
   mode = ModeConfiguration(file,standalone)
   v=(master,slave)
   rules=(new ShardingRuleConfigurationYamlSwapper()).swapToObject(YamlReadwriteSplittingRuleConfiguration[from yml])
    ShardingSphereDataSource shardingSphereDataSource =
                           (ShardingSphereDataSource) ShardingSphereDataSourceFactory.createDataSource(
                                   k, mode, v, rules, shardingProps.getProps());
   ```
   
   ![image](https://user-images.githubusercontent.com/15647179/144033060-53cfc633-fb53-436c-80b6-b4e826abbd71.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033133-cefef7a2-4b36-49ca-86bc-b0e5afcbeacf.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033184-ced25c4f-f2a2-48aa-b736-3d45cba60455.png)
   ![image](https://user-images.githubusercontent.com/15647179/144033271-96e3d0e7-fde7-4238-82fb-e34519ac10cd.png)
   dbA-dataSources:
   ```
   xxxxx-master:
     schema: null
     transactionIsolation: null
     exceptionOverrideClassName: null
     initializationFailTimeout: 1
     validationTimeout: 5000
     catalog: null
     maxLifetime: 30000
     leakDetectionThreshold: 0
     connectionInitSql: null
     minimumIdle: 2
     keepaliveTime: 0
     password: xxxxxx
     dataSourceJNDI: null
     connectionTestQuery: null
     idleTimeout: 60000
     driverClassName: com.mysql.cj.jdbc.Driver
     jdbcUrl: xxxxxxxxxxx
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     maximumPoolSize: 100
     connectionTimeout: 60000
     username: hq_db
     poolName: null
   xxxxxx-slave1:
     schema: null
     transactionIsolation: null
     exceptionOverrideClassName: null
     initializationFailTimeout: 1
     validationTimeout: 5000
     catalog: null
     maxLifetime: 30000
     leakDetectionThreshold: 0
     connectionInitSql: null
     minimumIdle: 2
     keepaliveTime: 0
     password: xxxxxxxxx
     dataSourceJNDI: null
     connectionTestQuery: null
     idleTimeout: 60000
     driverClassName: com.mysql.cj.jdbc.Driver
     jdbcUrl: xxxxxxxxxxxx
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     maximumPoolSize: 100
     connectionTimeout: 60000
     username: hq_db
     poolName: null
   
   ````
   
   db2-Datasource :
   Omitted, basically consistent with the above
   
   When progarm restart,here will load all of the datasource of metadata(`StandaloneContextManagerBuilder`)
   ![image](https://user-images.githubusercontent.com/15647179/144033812-508ae24b-2e49-425c-ab1d-cebdcfe20ea1.png)
   


-- 
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] zt9788 closed issue #13830: When create mutil datasource and Use Mode Standalone that will be load twice pool

Posted by GitBox <gi...@apache.org>.
zt9788 closed issue #13830:
URL: https://github.com/apache/shardingsphere/issues/13830


   


-- 
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