📄 performance.po
字号:
"mapping has the following form:"msgstr "类或者集合映射的“<literal><cache></literal>元素”可以有下列形式:"#. Tag: programlisting#: performance.xml:693#, no-c-formatmsgid """<![CDATA[<cache \n"" usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"" region=\"RegionName\"\n"" include=\"all|non-lazy\"\n""/>]]>"msgstr ""#. Tag: para#: performance.xml:696#, no-c-formatmsgid """<literal>usage</literal> (required) specifies the caching strategy: ""<literal>transactional</literal>, <literal>read-write</literal>, ""<literal>nonstrict-read-write</literal> or <literal>read-only</literal>"msgstr """<literal>usage</literal>(必须)说明了缓存的策略: <literal>transactional</""literal>、 <literal>read-write</literal>、 <literal>nonstrict-read-write</""literal>或 <literal>read-only</literal>。"#. Tag: para#: performance.xml:705#, no-c-formatmsgid """<literal>region</literal> (optional, defaults to the class or collection ""role name) specifies the name of the second level cache region"msgstr """<literal>region</literal> (可选, 默认为类或者集合的名字(class or collection ""role name)) 指定第二级缓存的区域名(name of the second level cache region)"#. Tag: para#: performance.xml:712#, no-c-formatmsgid """<literal>include</literal> (optional, defaults to <literal>all</literal>) ""<literal>non-lazy</literal> specifies that properties of the entity mapped ""with <literal>lazy=\"true\"</literal> may not be cached when attribute-level ""lazy fetching is enabled"msgstr """<literal>include</literal> (可选,默认为 <literal>all</literal>) <literal>non-""lazy</literal> 当属性级延迟抓取打开时, 标记为<literal>lazy=\"true\"</literal>""的实体的属性可能无法被缓存"#. Tag: para#: performance.xml:722#, fuzzy, no-c-formatmsgid """Alternatively (preferably?), you may specify <literal><class-cache></""literal> and <literal><collection-cache></literal> elements in ""<literal>hibernate.cfg.xml</literal>."msgstr """另外(首选?), 你可以在hibernate.cfg.xml中指定<literal><class-cache></""literal>和 <literal><collection-cache></literal> 元素。"#. Tag: para#: performance.xml:727#, no-c-formatmsgid """The <literal>usage</literal> attribute specifies a <emphasis>cache ""concurrency strategy</emphasis>."msgstr """这里的<literal>usage</literal> 属性指明了<emphasis>缓存并发策略(cache ""concurrency strategy)</emphasis>。"#. Tag: title#: performance.xml:734#, no-c-formatmsgid "Strategy: read only"msgstr "策略:只读缓存(Strategy: read only)"#. Tag: para#: performance.xml:736#, no-c-formatmsgid """If your application needs to read but never modify instances of a persistent ""class, a <literal>read-only</literal> cache may be used. This is the ""simplest and best performing strategy. It's even perfectly safe for use in a ""cluster."msgstr """如果你的应用程序只需读取一个持久化类的实例,而无需对其修改, 那么就可以对其进""行<literal>只读</literal> 缓存。这是最简单,也是实用性最好的方法。甚至在集群""中,它也能完美地运作。"#. Tag: programlisting#: performance.xml:742#, no-c-formatmsgid """<![CDATA[<class name=\"eg.Immutable\" mutable=\"false\">\n"" <cache usage=\"read-only\"/>\n"" ....\n""</class>]]>"msgstr ""#. Tag: title#: performance.xml:748#, no-c-formatmsgid "Strategy: read/write"msgstr "策略:读/写缓存(Strategy: read/write)"#. Tag: para#: performance.xml:750#, no-c-formatmsgid """If the application needs to update data, a <literal>read-write</literal> ""cache might be appropriate. This cache strategy should never be used if ""serializable transaction isolation level is required. If the cache is used ""in a JTA environment, you must specify the property <literal>hibernate.""transaction.manager_lookup_class</literal>, naming a strategy for obtaining ""the JTA <literal>TransactionManager</literal>. In other environments, you ""should ensure that the transaction is completed when <literal>Session.close()""</literal> or <literal>Session.disconnect()</literal> is called. If you wish ""to use this strategy in a cluster, you should ensure that the underlying ""cache implementation supports locking. The built-in cache providers do ""<emphasis>not</emphasis>."msgstr """如果应用程序需要更新数据,那么使用<literal>读/写缓存</literal> 比较合适。 如""果应用程序要求“序列化事务”的隔离级别(serializable transaction isolation ""level),那么就决不能使用这种缓存策略。 如果在JTA环境中使用缓存,你必须指定""<literal>hibernate.transaction.manager_lookup_class</literal>属性的值, 通过""它,Hibernate才能知道该应用程序中JTA的<literal>TransactionManager</literal>的""具体策略。 在其它环境中,你必须保证在<literal>Session.close()</literal>、或""<literal>Session.disconnect()</literal>调用前, 整个事务已经结束。 如果你想在""集群环境中使用此策略,你必须保证底层的缓存实现支持锁定(locking)。Hibernate内""置的缓存策略并不支持锁定功能。"#. Tag: programlisting#: performance.xml:761#, no-c-formatmsgid """<![CDATA[<class name=\"eg.Cat\" .... >\n"" <cache usage=\"read-write\"/>\n"" ....\n"" <set name=\"kittens\" ... >\n"" <cache usage=\"read-write\"/>\n"" ....\n"" </set>\n""</class>]]>"msgstr ""#. Tag: title#: performance.xml:766#, no-c-formatmsgid "Strategy: nonstrict read/write"msgstr "策略:非严格读/写缓存(Strategy: nonstrict read/write)"#. Tag: para#: performance.xml:768#, no-c-formatmsgid """If the application only occasionally needs to update data (ie. if it is ""extremely unlikely that two transactions would try to update the same item ""simultaneously) and strict transaction isolation is not required, a ""<literal>nonstrict-read-write</literal> cache might be appropriate. If the ""cache is used in a JTA environment, you must specify <literal>hibernate.""transaction.manager_lookup_class</literal>. In other environments, you ""should ensure that the transaction is completed when <literal>Session.close()""</literal> or <literal>Session.disconnect()</literal> is called."msgstr """如果应用程序只偶尔需要更新数据(也就是说,两个事务同时更新同一记录的情况很不""常见),也不需要十分严格的事务隔离, 那么比较适合使用<literal>非严格读/写缓存""</literal>策略。如果在JTA环境中使用该策略, 你必须为其指定<literal>hibernate.""transaction.manager_lookup_class</literal>属性的值, 在其它环境中,你必须保证""在<literal>Session.close()</literal>、或<literal>Session.disconnect()</""literal>调用前, 整个事务已经结束。"#. Tag: title#: performance.xml:780#, no-c-formatmsgid "Strategy: transactional"msgstr "策略:事务缓存(transactional)"#. Tag: para#: performance.xml:782#, no-c-formatmsgid """The <literal>transactional</literal> cache strategy provides support for ""fully transactional cache providers such as JBoss TreeCache. Such a cache ""may only be used in a JTA environment and you must specify ""<literal>hibernate.transaction.manager_lookup_class</literal>."msgstr """Hibernate的<literal>事务缓存</literal>策略提供了全事务的缓存支持, 例如对""JBoss TreeCache的支持。这样的缓存只能用于JTA环境中,你必须指定 为其""<literal>hibernate.transaction.manager_lookup_class</literal>属性。"#. Tag: title#: performance.xml:791#, fuzzy, no-c-formatmsgid "Cache-provider/concurrency-strategy compatibility"msgstr """各种缓存提供商对缓存并发策略的支持情况(Cache Concurrency Strategy Support)"#. Tag: para#: performance.xml:794#, fuzzy, no-c-formatmsgid """None of the cache providers support all of the cache concurrency strategies."msgstr """没有一种缓存提供商能够支持上列的所有缓存并发策略。下表中列出了各种提供器、及""其各自适用的并发策略。"#. Tag: para#: performance.xml:799#, fuzzy, no-c-formatmsgid """The following table shows which providers are compatible with which ""concurrency strategies."msgstr """没有一种缓存提供商能够支持上列的所有缓存并发策略。下表中列出了各种提供器、及""其各自适用的并发策略。"#. Tag: title#: performance.xml:804#, no-c-formatmsgid "Cache Concurrency Strategy Support"msgstr """各种缓存提供商对缓存并发策略的支持情况(Cache Concurrency Strategy Support)"#. Tag: entry#: performance.xml:814#, no-c-formatmsgid "read-only"msgstr "read-only"#. Tag: entry#: performance.xml:815#, no-c-formatmsgid "nonstrict-read-write"msgstr "nonstrict-read-write"#. Tag: entry#: performance.xml:816#, no-c-formatmsgid "read-write"msgstr "read-write"#. Tag: entry#: performance.xml:817#, no-c-formatmsgid "transactional"msgstr "transactional"#. Tag: title#: performance.xml:872#, no-c-formatmsgid "Managing the caches"msgstr "管理缓存(Managing the caches)"#. Tag: para#: performance.xml:874#, no-c-formatmsgid """Whenever you pass an object to <literal>save()</literal>, <literal>update()</""literal> or <literal>saveOrUpdate()</literal> and whenever you retrieve an ""object using <literal>load()</literal>, <literal>get()</literal>, ""<literal>list()</literal>, <literal>iterate()</literal> or <literal>scroll()""</literal>, that object is added to the internal cache of the ""<literal>Session</literal>."msgstr """无论何时,当你给<literal>save()</literal>、<literal>update()</literal>或 ""<literal>saveOrUpdate()</literal>方法传递一个对象时,或使用<literal>load()</""literal>、 <literal>get()</literal>、<literal>list()</literal>、""<literal>iterate()</literal> 或<literal>scroll()</literal>方法获得一个对象""时, 该对象都将被加入到<literal>Session</literal>的内部缓存中。"#. Tag: para#: performance.xml:881#, no-c-formatmsgid """When <literal>flush()</literal> is subsequently called, the state of that ""object will be synchronized with the database. If you do not want this ""synchronization to occur or if you are processing a huge number of objects ""and need to manage memory efficiently, the <literal>evict()</literal> method ""may be used to remove the object and its collections from the first-level ""cache."msgstr """当随后flush()方法被调用时,对象的状态会和数据库取得同步。 如果你不希望此同步""操作发生,或者你正处理大量对象、需要对有效管理内存时,你可以调用""<literal>evict()</literal> 方法,从一级缓存中去掉这些对象及其集合。"#. Tag: programlisting#: performance.xml:889#, no-c-formatmsgid """<![CDATA[ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll""(); //a huge result set\n""while ( cats.next() ) {\n"" Cat cat = (Cat) cats.get(0);\n"" doSomethingWithACat(cat);\n"" sess.evict(cat);\n""}]]>"msgstr ""#. Tag: para#: performance.xml:891#, no-c-formatmsgid """The <literal>Session</literal> also provides a <literal>contains()</literal> ""method to determine if an instance belongs to the session cache."msgstr """Session还提供了一个<literal>contains()</literal>方法,用来判断某个实例是否处""于当前session的缓存中。"#. Tag: para#: performance.xml:896#, no-c-formatmsgid """To completely evict all objects from the session cache, call ""<literal>Session.clear()</literal>"msgstr """如若要把所有的对象从session缓存中彻底清除,则需要调用<literal>Session.clear()""</literal>。"#. Tag: para#: performance.xml:900#, no-c-formatmsgid """For the second-level cache, there are methods defined on ""<literal>SessionFactory</literal> for evicting the cached state of an ""instance, entire class, collection instance or entire collection role."msgstr """对于二级缓存来说,在<literal>SessionFactory</literal>中定义了许多方法, 清除""缓存中实例、整个类、集合实例或者整个集合。"#. Tag: programlisting#: performance.xml:906#, no-c-formatmsgid """<![CDATA[sessionFa
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -