📄 architecture.po
字号:
"保证</emphasis>持久化标识与Java标识(其值代表对象在内存中的位置)等价。"#. Tag: term#: architecture.xml:221#, no-c-formatmsgid "detached"msgstr "脱管(detached)"#. Tag: para#: architecture.xml:223#, fuzzy, no-c-formatmsgid """The instance was once associated with a persistence context, but that ""context was closed, or the instance was serialized to another process. It ""has a persistent identity and, perhaps, a corresponding row in the database. ""For detached instances, Hibernate makes no guarantees about the relationship ""between persistent identity and Java identity."msgstr """实例曾经与某个持久化上下文发生过关联,不过那个上下文被关闭了, 或者这个实例是""被序列化(serialize)到另外的进程。 它拥有持久化标识,并且在数据库中可能存在一""个对应的行。 对于脱管状态的实例,Hibernate不保证任何持久化标识和Java标识的关""系。"#. Tag: title#: architecture.xml:238#, no-c-formatmsgid "JMX Integration"msgstr "JMX整合"#. Tag: para#: architecture.xml:240#, no-c-formatmsgid """JMX is the J2EE standard for management of Java components. Hibernate may be ""managed via a JMX standard service. We provide an MBean implementation in ""the distribution, <literal>org.hibernate.jmx.HibernateService</literal>."msgstr """JMX是管理Java组件(Java components)的J2EE标准。 Hibernate 可以通过一个JMX标准""服务来管理。 在这个发行版本中,我们提供了一个MBean接口的实现,即 <literal>org.""hibernate.jmx.HibernateService</literal>。"#. Tag: para#: architecture.xml:246#, no-c-formatmsgid """For an example how to deploy Hibernate as a JMX service on the JBoss ""Application Server, please see the JBoss User Guide. On JBoss AS, you also ""get these benefits if you deploy using JMX:"msgstr """想要看如何在JBoss应用服务器上将Hibernate部署为一个JMX服务的例子,您可以参考""JBoss用户指南。 我们现在说一下在Jboss应用服务器上,使用JMX来部署Hibernate的好""处:"#. Tag: para#: architecture.xml:254#, no-c-formatmsgid """<emphasis>Session Management:</emphasis> The Hibernate <literal>Session</""literal>'s life cycle can be automatically bound to the scope of a JTA ""transaction. This means you no longer have to manually open and close the ""<literal>Session</literal>, this becomes the job of a JBoss EJB interceptor. ""You also don't have to worry about transaction demarcation in your code ""anymore (unless you'd like to write a portable persistence layer of course, ""use the optional Hibernate <literal>Transaction</literal> API for this). You ""call the <literal>HibernateContext</literal> to access a <literal>Session</""literal>."msgstr """<emphasis>Session管理:</emphasis> Hibernate的<literal>Session</literal>对象""的生命周期可以 自动跟一个JTA事务边界绑定。这意味着你无需手工开关""<literal>Session</literal>了, 这项 工作会由JBoss EJB 拦截器来完成。你再也不用""担心你的代码中的事务边界了(除非你想利用Hibernate提供可选 的""<literal>Transaction</literal> API来自己写一个便于移植的的持久层)。 你通过调""用<literal>HibernateContext</literal>来访问<literal>Session</literal>。"#. Tag: para#: architecture.xml:266#, no-c-formatmsgid """<emphasis>HAR deployment:</emphasis> Usually you deploy the Hibernate JMX ""service using a JBoss service deployment descriptor (in an EAR and/or SAR ""file), it supports all the usual configuration options of a Hibernate ""<literal>SessionFactory</literal>. However, you still have to name all your ""mapping files in the deployment descriptor. If you decide to use the ""optional HAR deployment, JBoss will automatically detect all mapping files ""in your HAR file."msgstr """<emphasis>HAR 部署:</emphasis> 通常情况下,你会使用JBoss的服务部署描述符(在""EAR或/和SAR文件中)来部署Hibernate JMX服务。 这种部署方式支持所有常见的""Hibernate <literal>SessionFactory</literal>的配置选项。 不过,你仍需在部署描""述符中,列出你所有的映射文件的名字。如果你使用HAR部署方式, JBoss 会自动探测出""你的HAR文件中所有的映射文件。"#. Tag: para#: architecture.xml:277#, no-c-formatmsgid """Consult the JBoss AS user guide for more information about these options."msgstr "这些选项更多的描述,请参考JBoss 应用程序用户指南。"#. Tag: para#: architecture.xml:281#, no-c-formatmsgid """Another feature available as a JMX service are runtime Hibernate statistics. ""See <xref linkend=\"configuration-optional-statistics\"/>."msgstr """将Hibernate以部署为JMX服务的另一个好处,是可以查看Hibernate的运行时统计信息。""参看 <xref linkend=\"configuration-optional-statistics\"/>."#. Tag: title#: architecture.xml:288#, no-c-formatmsgid "JCA Support"msgstr "对JCA的支持"#. Tag: para#: architecture.xml:289#, no-c-formatmsgid """Hibernate may also be configured as a JCA connector. Please see the website ""for more details. Please note that Hibernate JCA support is still considered ""experimental."msgstr """Hibernate也可以被配置为一个JCA连接器(JCA connector)。更多信息请参看网站。 ""请注意,Hibernate对JCA的支持,仍处于实验性阶段。"#. Tag: title#: architecture.xml:296#, no-c-formatmsgid "Contextual Sessions"msgstr "上下文相关的(Contextual)Session"#. Tag: para#: architecture.xml:297#, no-c-formatmsgid """Most applications using Hibernate need some form of \"contextual\" sessions, ""where a given session is in effect throughout the scope of a given context. ""However, across applications the definition of what constitutes a context is ""typically different; and different contexts define different scopes to the ""notion of current. Applications using Hibernate prior to version 3.0 tended ""to utilize either home-grown <literal>ThreadLocal</literal>-based contextual ""sessions, helper classes such as <literal>HibernateUtil</literal>, or ""utilized third-party frameworks (such as Spring or Pico) which provided ""proxy/interception-based contextual sessions."msgstr """使用Hibernate的大多数应用程序需要某种形式的“上下文相关的” session,特定的""session在整个特定的上下文范围内始终有效。然而,对不同类型的应用程序而言,要为""什么是组成这种“上下文”下一个定义通常是困难的;不同的上下文对“当前”这个概念定""义了不同的范围。在3.0版本之前,使用Hibernate的程序要么采用自行编写的基于""<literal>ThreadLocal</literal>的上下文session,要么采用""<literal>HibernateUtil</literal>这样的辅助类,要么采用第三方框架(比如Spring""或Pico),它们提供了基于代理(proxy)或者基于拦截器(interception)的上下文相关""session。"#. Tag: para#: architecture.xml:306#, no-c-formatmsgid """Starting with version 3.0.1, Hibernate added the <literal>SessionFactory.""getCurrentSession()</literal> method. Initially, this assumed usage of ""<literal>JTA</literal> transactions, where the <literal>JTA</literal> ""transaction defined both the scope and context of a current session. The ""Hibernate team maintains that, given the maturity of the numerous stand-""alone <literal>JTA TransactionManager</literal> implementations out there, ""most (if not all) applications should be using <literal>JTA</literal> ""transaction management whether or not they are deployed into a ""<literal>J2EE</literal> container. Based on that, the <literal>JTA</literal>-""based contextual sessions is all you should ever need to use."msgstr """从3.0.1版本开始,Hibernate增加了<literal>SessionFactory.getCurrentSession()</""literal>方法。一开始,它假定了采用<literal>JTA</literal>事务,<literal>JTA</""literal>事务定义了当前session的范围和上下文(scope and context)。Hibernate开发""团队坚信,因为有好几个独立的<literal>JTA TransactionManager</literal>实现稳定""可用,不论是否被部署到一个<literal>J2EE</literal>容器中,大多数(假若不是所有""的)应用程序都应该采用<literal>JTA</literal>事务管理。基于这一点,采用""<literal>JTA</literal>的上下文相关session可以满足你一切需要。"#. Tag: para#: architecture.xml:316#, no-c-formatmsgid """However, as of version 3.1, the processing behind <literal>SessionFactory.""getCurrentSession()</literal> is now pluggable. To that end, a new extension ""interface (<literal>org.hibernate.context.CurrentSessionContext</literal>) ""and a new configuration parameter (<literal>hibernate.""current_session_context_class</literal>) have been added to allow ""pluggability of the scope and context of defining current sessions."msgstr """更好的是,从3.1开始,<literal>SessionFactory.getCurrentSession()</literal>的""后台实现是可拔插的。因此,我们引入了新的扩展接口(<literal>org.hibernate.""context.CurrentSessionContext</literal>)和新的配置参数(<literal>hibernate.""current_session_context_class</literal>),以便对什么是“当前session”的范围和上""下文(scope and context)的定义进行拔插。"#. Tag: para#: architecture.xml:323#, no-c-formatmsgid """See the Javadocs for the <literal>org.hibernate.context.""CurrentSessionContext</literal> interface for a detailed discussion of its ""contract. It defines a single method, <literal>currentSession()</literal>, ""by which the implementation is responsible for tracking the current ""contextual session. Out-of-the-box, Hibernate comes with three ""implementations of this interface."msgstr """请参阅<literal>org.hibernate.context.CurrentSessionContext</literal>接口的""Javadoc,那里有关于它的契约的详细讨论。它定义了单一的方法,""<literal>currentSession()</literal>,特定的实现用它来负责跟踪当前的上下文""session。Hibernate内置了此接口的三种实现。"#. Tag: para#: architecture.xml:333#, no-c-formatmsgid """<literal>org.hibernate.context.JTASessionContext</literal> - current ""sessions are tracked and scoped by a <literal>JTA</literal> transaction. The ""processing here is exactly the same as in the older JTA-only approach. See ""the Javadocs for details."msgstr """<literal>org.hibernate.context.JTASessionContext</literal> - 当前session根据""<literal>JTA</literal>来跟踪和界定。这和以前的仅支持JTA的方法是完全一样的。详""情请参阅Javadoc。"#. Tag: para#: architecture.xml:341#, no-c-formatmsgid """<literal>org.hibernate.context.ThreadLocalSessionContext</literal> - current ""sessions are tracked by thread of execution. Again, see the Javadocs for ""details."msgstr """<literal>org.hibernate.context.ThreadLocalSessionContext</literal> - 当前""session通过当前执行的线程来跟踪和界定。详情也请参阅Javadoc。"#. Tag: para#: architecture.xml:347#, no-c-formatmsgid """<literal>org.hibernate.context.ManagedSessionContext</literal> - current ""sessions are tracked by thread of execution. However, you are responsible to ""bind and unbind a <literal>Session</literal> instance with static methods on ""this class, it does never open, flush, or close a <literal>Session</literal>."msgstr """<literal>org.hibernate.context.ManagedSessionContext</literal> - 当前session""通过当前执行的线程来跟踪和界定。但是,你需要负责使用这个类的静态方法将""<literal>Session</literal>实例绑定、或者取消绑定,它并不会打开(open)、flush或""者关闭(close)任何<literal>Session</literal>。"#. Tag: para#: architecture.xml:356#, fuzzy, no-c-formatmsgid """The first two implementations provide a \"one session - one database ""transaction\" programming model, also known and used as <emphasis>session-""per-request</emphasis>. The beginning and end of a Hibernate session is ""defined by the duration of a database transaction. If you use programmatic ""transaction demarcation in plain JSE without JTA, you are advised to use the ""Hibernate <literal>Transaction</literal> API to hide the underlying ""transaction system from your code. If you use JTA, use the JTA interfaces to ""demarcate transactions. If you execute in an EJB container that supports ""CMT, transaction boundaries are defined declaratively and you don't need any ""transaction or session demarcation operations in your code. Refer to <xref ""linkend=\"transactions\"/> for more information and code examples."msgstr """前两种实现都提供了“每数据库事务对应一个session”的编程模型,也称作<emphasis>每""次请求一个session</emphasis>。Hibernate session的起始和终结由数据库事务的生存""来控制。假若你在纯粹的 Java SE之上采用自行编写代码来管理事务,而不使用JTA,建""议你使用Hibernate <literal>Transaction</literal> API来把底层事务实现从你的代""码中隐藏掉。如果你使用JTA,请使用JTA借口来管理Transaction。如果你在支持CMT的""EJB容器中执行代码,事务边界是声明式定义的,你不需要在代码中进行任何事务或""session管理操作。请参阅<xref linkend=\"transactions\"/>一节来阅读更多的内容和""示例代码。"#. Tag: para#: architecture.xml:368#, no-c-formatmsgid """The <literal>hibernate.current_session_context_class</literal> configuration ""parameter defines which <literal>org.hibernate.context.""CurrentSessionContext</literal> implementation should be used. Note that for ""backwards compatibility, if this config param is not set but a <literal>org.""hibernate.transaction.TransactionManagerLookup</literal> is configured, ""Hibernate will use the <literal>org.hibernate.context.JTASessionContext</""literal>. Typically, the value of this parameter would just name the ""implementation class to use; for the three out-of-the-box implementations, ""however, there are three corresponding short names, \"jta\", \"thread\", and ""\"managed\"."msgstr """<literal>hibernate.current_session_context_class</literal>配置参数定义了应该""采用哪个<literal>org.hibernate.context.CurrentSessionContext</literal>实现。""注意,为了向下兼容,如果未配置此参数,但是存在<literal>org.hibernate.""transaction.TransactionManagerLookup</literal>的配置,Hibernate会采用""<literal>org.hibernate.context.JTASessionContext</literal>。一般而言,此参数""的值指明了要使用的实现类的全名,但那三种内置的实现可以使用简写,即\"jta\"、""\"thread\"和\"managed\"。"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -