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 2020/02/13 05:59:22 UTC
[GitHub] [incubator-shardingsphere] gxgmy521 opened a new issue #4280: Why
the readOnly filed in the ShardingConnection is true.
gxgmy521 opened a new issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280
## Question
When get a shardingConnection , the `readOnly` filed is aways true,however ,the same filed in the pthysical datasource connection is false. Can you explain why in the `AbstractConnectionAdapter` class the readOnly is true
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] ssxlulu commented on issue #4280: Why
the readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
ssxlulu commented on issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280#issuecomment-591213529
I have researched some documents. The default value of read only in [MySQL](https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_read_only) or [PostgreSQL](https://www.postgresql.org/docs/current/runtime-config-client.html) is false.Like the following pictures show:
MySQL:
![image](https://user-images.githubusercontent.com/14773179/75307158-fd319080-5885-11ea-9bc1-e5ee23dae6e4.png)
PostgreSQL:
![image](https://user-images.githubusercontent.com/14773179/75307197-1cc8b900-5886-11ea-99ee-5b9531e2006c.png)
So, I think the read only value in AbstractConnectionAdapter should be false as well by default.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] terrymanu commented on issue #4280: Why
the readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280#issuecomment-590693842
Thank you, assigned @ssxlulu
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] gxgmy521 edited a comment on issue
#4280: Why the readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
gxgmy521 edited a comment on issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280#issuecomment-587002212
You can see in the https://github.com/apache/incubator-shardingsphere/blob/master/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/AbstractConnectionAdapter.java
the ·`readOnly`value of the AbstractConnectionAdapter is set to true
```
private boolean readOnly = true;
```
However when we get a connection from the Hikari or Druid. the default value is false。On the User side the readOnly value is true( get from the logic ShardingConnection), On the datasource sider, the value is false (get from the physical datasource connection).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] gxgmy521 commented on issue #4280: Why
the readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
gxgmy521 commented on issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280#issuecomment-587002212
You can see in the https://github.com/apache/incubator-shardingsphere/blob/master/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/AbstractConnectionAdapter.java
the ·`readOnly`value of the AbstractConnectionAdapter is set to true
```
private boolean readOnly = true;
```
However when we get a connection from the Hikari or Druid. the default value is false。
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] gxgmy521 edited a comment on issue
#4280: Why the readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
gxgmy521 edited a comment on issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280#issuecomment-587002212
You can see in the https://github.com/apache/incubator-shardingsphere/blob/master/sharding-jdbc/sharding-jdbc-core/src/main/java/org/apache/shardingsphere/shardingjdbc/jdbc/adapter/AbstractConnectionAdapter.java
the ·`readOnly`value of the AbstractConnectionAdapter is set to true
```
private boolean readOnly = true;
```
However when we get a connection from the Hikari or Druid. the default value is false。On the User side the readOnly value is true( get from the logic ShardingConnection), On the database side, the value is false (get from the physical datasource connection).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] terrymanu commented on issue #4280: Why
the readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280#issuecomment-586993018
Any hints to reproduce 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] ssxlulu commented on issue #4280: Why
the readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
ssxlulu commented on issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280#issuecomment-590692297
It may be a problem about readonly transaction, I will research it further.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-shardingsphere] terrymanu closed issue #4280: Why the
readOnly filed in the ShardingConnection is true.
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #4280: Why the readOnly filed in the ShardingConnection is true.
URL: https://github.com/apache/incubator-shardingsphere/issues/4280
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services