`
wutao8818
  • 浏览: 612684 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Hibernate Shards 3.0.0.Beta2存在的限制

阅读更多
来源 Hibernate Shards docs

6.1. Incomplete Implementation of Hibernate API
未完整的实现Hibernate API.

In order to speed-up the initial release of Hibernate Shards, some parts of the Hibernate API that we rarely use were left unimplemented. Of course things that we rarely used are probably critical for some applications, so if we've left you out in the cold we apologize. We're committed to getting the rest of the API implemented quickly. For details on which methods were not implemented, please see the Javadoc for ShardedSessionImpl, ShardedCriteriaImpl, and ShardedQueryImpl.

为了加快最初版本的Hibernate Shards发布,一些我们很少使用的部分Hibernate API没有被实现。当然我们很少使用的那些API也许是一些应用程序的关键部分,对此让你造成的冷遇我们表示抱歉。对于未实现的方法的细节,请看ShardedSessionImpl, ShardedCriteriaImpl, and ShardedQueryImpl Javadoc 文档。

6.2. Cross-Shard Object Graphs
Hibernate Shards does not currently support cross-shard object graphs.

In other words, it is illegal to create an association between objects A and B when A and B live on different shards.

Hibernate will consider the "bad" object in the list to be a new object and, assuming you have cascades enabled for this relationship, it will create a new version of this object on a different shard. This is trouble. In order to help prevent this sort of thing from happening we have an interceptor called CrossShardRelationshipDetectingInterceptor that checks for cross-shard relationships on every object that is created or saved.
Unfortunately there is a cost associated with using the CrossShardRelationshipDetectingInterceptor. In order to determine the shard on which an associated object resides we need to fetch the object from the database, so if you have lazy-loaded associations the interceptor will resolve those associations as part of its checks. This is potentially quite expensive, and may not be suitable for a production system. With this in mind, we've made it easy to configure whether or not this check is performed via the "hibernate.shard.enable_cross_shard_relationship_checks" property we referenced in the chapter on configuration. If this property is set to "true" a CrossShardRelationshipDetectingInterceptor will be registered with every ShardedSession that is established. Don't worry, you can still register your own interceptor as well. Our expectation is that most applications will have this check enabled in their dev and qa environments and disabled in their staging, load and performance, and production environments.

无法创建跨shard对象图。换句话说就是,如果要创建跨越shards的2个对象A和B的关联,那将是非法的。Hibernate将认为是新对象,假如对这个关系你配置了cascades功能,将自动创建这个对象。这是个问题,为了防止此类问题的发生,我们使用一个拦截器叫CrossShardRelationshipDetectingInterceptor在每个对象创建或保存的时刻来检测这跨shard的关系。

可以通过配置hibernate.shard.enable_cross_shard_relationship_checks参数

6.3. Distributed Transactions
分布式事务
Hibernate Shards does not provide support for distributed transactions within a non-managed environment. If your application requires distributed transactions you need to plug in a transaction management implementation that supports distributed transactions.

Hibernate Shards在一个无管理的环境不能提供分布式事务。如果你的程序需要一个分布式事务,你需要插入一个分布式事务管理实现来支持分布式事务。


6.4. Stateful Interceptors

拦截器

6.5. Objects With Ids That Are Base Types

ID基础类型
we don't support base types. id can be represented by a Serializable (or autoboxed into a Serializable).

6.6. Replicated Data
复制数据

看来Shards还存在不少的问题。至少在一个不断发展的平台(数据关系还不稳定的平台上)还不太合适。
分享到:
评论

相关推荐

    hibernate-shards-3.0.0.Beta2.zip

    在hibernate-shards-3.0.0.Beta2版本中,我们可以看到Hibernate Shards对数据分片策略的进一步优化和完善。 一、Hibernate Shards概述 Hibernate Shards的核心思想是将一个大型数据库分为多个较小的部分,这些部分...

    hibernate-shards.jar

    as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and ...

    使用 Hibernate Shards 对数据进行切分

    2. 分片透明化:对于应用程序来说,使用Hibernate Shards与使用普通Hibernate几乎没有区别。开发者无需关心数据位于哪个分片,只需进行正常的CRUD操作,框架会自动处理数据路由。 3. 横向扩展:随着业务增长,可以...

    Mirror.The.Lost.Shards.Update.v3.10_补丁_Lost!_emoji_

    该补丁的文件名"Mirror.The.Lost.Shards.Update.v3.10"直接反映了其核心内容,即对《魔镜:失落碎片》的v3.10版本进行更新。从命名来看,我们可以推测这个更新可能包含了对游戏性能的优化、bug修复以及新内容的添加...

    PyPI 官网下载 | geonode_datastore_shards-0.1.tar.gz

    《PyPI官网下载:探索geonode_datastore_shards-0.1.tar.gz中的技术细节》 在Python的生态系统中,PyPI(Python Package Index)是最重要的资源库,它为开发者提供了一个分享和获取Python软件包的平台。本文将深入...

    hibernate-shards:Hibernate ORM的水平分区

    《Hibernate Shards:Hibernate ORM的水平分区探索》 Hibernate Shards是Hibernate ORM框架的一个扩展,专门设计用于处理大数据量的分布式环境中的水平分区问题。然而,值得注意的是,这个项目目前已经不再受到官方...

    计算机-软件工程-外文翻译-外文文献-英文文献.doc

    2. Hibernate Shards:Hibernate Shards 是一个基于 Java 的开源框架,用于实现数据库切分。它可以将一个大型数据库拆分成多个小的逻辑数据库,并提供了易于使用的 API 来管理这些小数据库。 3. 切分策略:文章讨论...

    Hibernate的版本

    Hibernate Shards (3.0.0 Beta) - **发布日期**:2007年08月02日 - **状态**:开发中(Development) 这是一个实验性质的项目,旨在支持数据分片。尽管还处于测试阶段,但已经可以用于实现水平分区策略,以提高大...

    Crystal​语言依赖管理器shards.zip

    shards 是 Crystal 语言的依赖管理器。使用name: shards version: 0.1.0 dependencies:  openssl:  github: datanoise/openssl.cr  branch: master development_dependencies:  minitest:  git: ...

    Hibernate3详解

    4. Hibernate Shards:水平数据分区框架,用于分布式数据库管理。 5. Hibernate Validator:数据完整性和验证API。 6. Hibernate Search:与Lucene集成,用于索引和查询数据。 7. Hibernate Tools:为Eclipse和Ant...

    shards.zip

    一个现代且免费的Bootstrap 4后台管理模块,用起来非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,非常丝滑,...

    shards-info:https:shards.info的源代码

    安装依赖项shards install 将.env.example重命名为.env并设置变量。 运行它crystal src/shards-info.cr 发展历程 psql -c 'CREATE DATABASE shards_info_development;' -U postgres crystal src/db.cr migrate ...

    hibernate-sharding

    Hibernate分片 用于演示Hibernate分片的示例项目。 hibernate1.cfg.xml文件的...hibernate2.cfg.xml用于第二个分片 应用程序脱机启动共享ID生成,分片选择和分片解析策略。 在构建项目之前执行maven-install.sh文件。

    ShardsDashboardUIKit一个现代免费的Bootstrap4后台管理仪表板模板包

    **Shards Dashboard UI Kit** 是一个专为现代Web应用程序设计的免费、开源的Bootstrap 4后台管理仪表板模板。这个工具包提供了丰富的组件和页面示例,为开发者提供了一个高效的工作起点,帮助他们快速构建功能完备、...

    Hibernate深入浅出

    最后,可能会涉及一些进阶话题,比如Hibernate与JPA的比较、Shards和多数据源配置,以及如何在分布式环境中使用Hibernate等。 总的来说,《Hibernate深入浅出》是一本覆盖了Hibernate各个方面知识的全面指南,无论...

Global site tag (gtag.js) - Google Analytics