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/01/20 08:44:52 UTC

[GitHub] [shardingsphere] yage-czy commented on issue #970: 执行hibernate实体对象update时遍历所有表

yage-czy commented on issue #970:
URL: https://github.com/apache/shardingsphere/issues/970#issuecomment-1017241107


   > hello, we prefer use english to discuss issue. we don't care the SQL that hibernate auto generated. We just care about if SQL include sharding-key, then route to correct data nodes; if SQL exclude sharding-key, then route to all data nodes.
   > 
   > So what I want to know is that any question here?
   
   问题在于:第一,sharding的官网明确说明了【适用于任何基于 JDBC 的 ORM 框架,如:JPA, Hibernate, Mybatis, Spring JDBC Template 或直接使用 JDBC。】其中jpa排在首位,而jpa的save方法是使用率极高的。所以此处你说“we don't care the SQL that hibernate auto generated”我认为有些不妥。
   第二,sharding的目的在于实现分库分表,使项目在大数据场景下效率更好,而此处调用save方法却会遍历所有的库进行操作,对于性能肯定是有影响的。
   第三,遍历所有的库进行save操作,难道不会产生脏数据吗?


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