[jboss-cvs] JBossAS SVN: r83588 - projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jan 28 22:50:05 EST 2009
Author: xhuang at jboss.com
Date: 2009-01-28 22:50:05 -0500 (Wed, 28 Jan 2009)
New Revision: 83588
Modified:
projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/Clustering_Guide_Entity_EJBs.po
Log:
update
Modified: projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/Clustering_Guide_Entity_EJBs.po
===================================================================
--- projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/Clustering_Guide_Entity_EJBs.po 2009-01-29 01:53:58 UTC (rev 83587)
+++ projects/docs/enterprise/4.3.3/Server_Configuration_Guide/zh-CN/Clustering_Guide_Entity_EJBs.po 2009-01-29 03:50:05 UTC (rev 83588)
@@ -1,18 +1,21 @@
+# translation of Clustering_Guide_Entity_EJBs.po to
# Language /tmp/mike/JBEAP420/JBAS translations for JBEAP package.
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
# Automatically generated, 2007.
-#
+# Xi HUANG <xhuang at redhat.com>, 2009.
msgid ""
msgstr ""
-"Project-Id-Version: JBEAP 420\n"
+"Project-Id-Version: Clustering_Guide_Entity_EJBs\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-20 02:37+0000\n"
-"PO-Revision-Date: 2001-02-09 01:25+0100\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2009-01-29 13:50+1000\n"
+"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
+"Language-Team: <en at li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
#. Tag: title
#: Clustering_Guide_Entity_EJBs.xml:5
@@ -22,25 +25,25 @@
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:6
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"In a JBoss AS cluster, the entity bean instance caches need to be kept in "
"sync across all nodes. If an entity bean provides remote services, the "
"service methods need to be load balanced as well."
msgstr ""
-"在 JBoss AS 群集系统里,entity bean 实例需要跨节点的复制。如果某个 entity "
-"bean 提供远程服务,那么服务方法(service methods)也需要进行负载平衡。"
+"在 JBoss AS 群集系统里,entity bean 实例需要在所有节点间保持同步。如果某个 entity "
+"bean 提供了远程服务,那么该服务的方法也需要进行负载平衡。"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:8
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"To use a clustered entity bean, the application does not need to do anything "
"special, except for looking up EJB 2.x remote bean references from the "
"clustered HA-JNDI."
msgstr ""
"为了使用群集的 entity bean,应用程序不需要做任何特殊的事情,除了从群集的 HA-"
-"JNDI 里查找 bean 的引用。"
+"JNDI 里查找 EJB 2.x bean 的远程引用。"
#. Tag: title
#: Clustering_Guide_Entity_EJBs.xml:10
@@ -50,7 +53,7 @@
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:11
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"First of all, it is worth noting that clustering 2.x entity beans is a bad "
"thing to do. Its exposes elements that generally are too fine grained for "
@@ -60,7 +63,7 @@
"only, or one read-write node with read-only nodes synched with the cache "
"invalidation services."
msgstr ""
-"首先,值得注意的是群集 2.x 的 entity beans 不是件好事。它向群集的远程对象开放"
+"首先,值得注意的是使用群集 2.x 的 entity bean 并非好主意。它向群集的远程对象开放"
"(exposes)通常过于细颗粒度的元素(elements),导致了严重的数据同步问题。除非"
"你遇到特殊的情况,如只读或者只写的节点和使用缓存失效服务(cache invalidation "
"services)的只读节点同步,否则不要使用 EJB 2.x entity bean 的群集。"
@@ -214,7 +217,7 @@
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:46
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"To avoid round trips to the database, you can use a cache for your entities. "
"JBoss EJB 3.0 entity beans are implemented by Hibernate, which has support "
@@ -224,8 +227,7 @@
"functionalities."
msgstr ""
"为了避免多次访问数据库,你可以为你的 entities 使用缓存。JBoss EJB 3.0 是用 "
-"Hibernate 实现的,它支持两级缓存。用于 JBoss EJB 3.0 实现的 Hibernate setup "
-"把 JBoss Cache 当作底层缓存实现使用。这个缓存提供了下面的功能:"
+"Hibernate 实现的,它支持两级缓存。用于 JBoss EJB 3.0 实现的 Hibernate 把 JBoss Cache 当作底层缓存实现使用。这个缓存提供了下面的功能:"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:49
@@ -270,7 +272,7 @@
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:65
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"The JBoss Cache service for EJB 3.0 entity beans is configured in a "
"<literal>TreeCache</literal> MBean in the <literal>deploy/ejb3-entity-cache-"
@@ -281,15 +283,13 @@
"element <literal>ClusterConfig</literal>."
msgstr ""
"JEJB 3.0 entity beans 采用的 Boss Cache 服务在 <literal>deploy/ejb3-entity-"
-"cache-service.xml</literal> 文件里的 <literal>TreeCache</literal> MBean(请参"
-"考<xref linkend=\"jbosscache-cache\"/>) 里被配置。缓存 MBean 服务名是"
-"<literal>jboss.cache:service=EJB3EntityTreeCache</literal>。下面是标准 JBoss "
+"cache-service.xml</literal> 文件里的 <literal>TreeCache</literal> MBean 里被配置。缓存 MBean 服务名是 <literal>jboss.cache:service=EJB3EntityTreeCache</literal>。下面是标准 JBoss "
"发行版本里的 <literal>ejb3-entity-cache-service.xml</literal> 文件的内容。我"
"们再次忽略了 JGroups 的配置元素 <literal>ClusterConfig</literal>。"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:71
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[ \n"
" <server>\n"
@@ -346,70 +346,70 @@
"</server>\n"
"]]>"
msgstr ""
-"<server>\n"
-" <mbean code=\"org.jboss.cache.TreeCache\" \n"
-" name=\"jboss.cache:service=EJB3EntityTreeCache\">\n"
-" \n"
-" <depends>jboss:service=Naming</depends>\n"
-" <depends>jboss:service=TransactionManager</depends>\n"
-"\n"
-" <!-- Configure the TransactionManager -->\n"
-" <attribute name=\"TransactionManagerLookupClass\">\n"
-" org.jboss.cache.JBossTransactionManagerLookup\n"
-" </attribute>\n"
-"\n"
-" <attribute name=\"IsolationLevel\">REPEATABLE_READ</"
-"attribute>\n"
-" <attribute name=\"CacheMode\">REPL_SYNC</attribute>\n"
-"\n"
-" <!--Name of cluster. Needs to be the same for all clusters, \n"
-" in order to find each other -->\n"
-" <attribute name=\"ClusterName\">EJB3-entity-cache</"
-"attribute>\n"
-"\n"
-" <attribute name=\"ClusterConfig\">\n"
-" ... ...\n"
-" </attribute>\n"
-"\n"
-" <attribute name=\"InitialStateRetrievalTimeout\">5000</"
-"attribute>\n"
-" <attribute name=\"SyncReplTimeout\">10000</attribute>\n"
-" <attribute name=\"LockAcquisitionTimeout\">15000</"
-"attribute>\n"
-"\n"
-" <attribute name=\"EvictionPolicyClass\">\n"
-" org.jboss.cache.eviction.LRUPolicy\n"
-" </attribute>\n"
-"\n"
-" <!-- Specific eviction policy configurations. This is LRU --"
-">\n"
-" <attribute name=\"EvictionPolicyConfig\">\n"
-" <config>\n"
-" <attribute name=\"wakeUpIntervalSeconds\">5</"
-"attribute>\n"
-" <!-- Cache wide default -->\n"
-" <region name=\"/_default_\">\n"
-" <attribute name=\"maxNodes\">5000</"
-"attribute>\n"
-" <attribute name=\"timeToLiveSeconds\">1000</"
-"attribute>\n"
-" </region>\n"
-" </config>\n"
-" </attribute>\n"
-" </mbean>\n"
-"</server>"
+"<![CDATA[ \n"
+" <server>\n"
+" <mbean code=\"org.jboss.cache.TreeCache\" \n"
+" name=\"jboss.cache:service=EJB3EntityTreeCache\">\n"
+" \n"
+" <depends>jboss:service=Naming</depends>\n"
+" <depends>jboss:service=TransactionManager</depends> \n"
+" \n"
+" <!-- Name of cluster. Needs to be the same on all nodes in the clusters, \n"
+" in order to find each other --> \n"
+" <attribute name=\"ClusterName\">\n"
+" ${jboss.partition.name:DefaultPartition}-EntityCache\n"
+" </attribute>\n"
+" \n"
+" <!-- Configure the TransactionManager -->\n"
+" <attribute name=\"TransactionManagerLookupClass\">\n"
+" org.jboss.cache.JBossTransactionManagerLookup\n"
+" </attribute>\n"
+" \n"
+" <attribute name=\"IsolationLevel\">REPEATABLE_READ</attribute>\n"
+" <attribute name=\"CacheMode\">REPL_SYNC</attribute> \n"
+" \n"
+" <!-- Must be true if any entity deployment uses a scoped "
+"classloader --> \n"
+" <attribute name=\"UseRegionBasedMarshalling\">true</attribute> \n"
+" <!-- Must match the value of \"useRegionBasedMarshalling\" --> \n"
+" <attribute name=\"InactiveOnStartup\">true</attribute>\n"
+" \n"
+" <attribute name=\"ClusterConfig\">\n"
+" ... ...\n"
+" </attribute>\n"
+" \n"
+" <attribute name=\"InitialStateRetrievalTimeout\">17500</attribute>\n"
+" <attribute name=\"SyncReplTimeout\">17500</attribute>\n"
+" <attribute name=\"LockAcquisitionTimeout\">15000</attribute>\n"
+" \n"
+" <attribute name=\"EvictionPolicyClass\">\n"
+" org.jboss.cache.eviction.LRUPolicy\n"
+" </attribute>\n"
+" \n"
+" <!-- Specific eviction policy configurations. This is LRU -->\n"
+" <attribute name=\"EvictionPolicyConfig\">\n"
+" <config>\n"
+" <attribute name=\"wakeUpIntervalSeconds\">5</attribute>\n"
+" <!-- Cache wide default -->\n"
+" <region name=\"/_default_\">\n"
+" <attribute name=\"maxNodes\">5000</attribute>\n"
+" <attribute name=\"timeToLiveSeconds\">1000</attribute>\n"
+" </region>\n"
+" </config>\n"
+" </attribute>\n"
+" </mbean>\n"
+"</server>\n"
+"]]>"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:73
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"This is a replicated cache, so, if running within a cluster, and the cache "
"is updated, changes to the entries in one node will be replicated to the "
"corresponding entries in the other nodes in the cluster."
msgstr ""
-"正如我们在 <xref linkend=\"jbosscache-cache\"/> 所讨论的,JBoss Cache 允许你"
-"指定缓存的 entities 的超时时间。在某个时段内没有被访问的 entities 将从缓存里"
-"删除,这样可以节省内存。如果这个缓存是在群集里运行,那么它会被更新。对某个节"
+"这是一个复制缓存,所以,如果这个缓存是在群集里运行,那么它会被更新,对某个节"
"点的 entries 的改动都会复制到群集里其他节点的相应条目里。"
#. Tag: para
@@ -428,7 +428,7 @@
"values of 5000 maxNodes and 1000 idle seconds are invalid for your "
"application(s), you can change the cache-wide defaults. You can also add "
"separate eviction regions for each of your entities; more on this below."
-msgstr ""
+msgstr "JBoss Cache 允许你指定缓存实体的超时时间。在某段时间内没有被访问的实体将从缓存里删除以节省内存。上面的配置设立了一个缺省的配置 region,它表示缓存最多可存储 5000 个节点,之后节点将从缓存里逐出,最少最近使用的节点将保留。而且,如果任何在最近的 1000 秒内没有被访问,它也将从缓存逐出。通常,缓存里的节点代表了一个缓存条目(实体、集合或查询结果集),但也有一些用于内部的其他节点。如果上面的 5000 最多节点数和 1000 秒空闲时间不适合你的应用程序,你可以修改群集范围内有效的缺省值。你也可以为每个实体添加单独的逐出 region,下面是更详细的内容。"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:80
@@ -481,11 +481,11 @@
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:91
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"The following property element defines the object name of the cache to be "
"used, i.e., the name of the TreeCache MBean shown above."
-msgstr "下面的属性元素定义了所使用的缓存对象名和 MBean 名。"
+msgstr "下面的属性元素定义了所使用的缓存对象名,也就是上面显示的 TreeCache MBean 的名称。"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:92
@@ -511,6 +511,9 @@
"properly grouped to allow the cache to properly manage classloading. <"
"property name=\"hibernate.cache.region_prefix\" value=\"myprefix\"/>"
msgstr ""
+"最后,你应该为这个配置取一个“region_prefix”。这个确保了所有和这个 persistence.xml 关联的缓存条目在 JBoss Cache 里进行正确分组。jboss.cache:"
+"service=EJB3EntityTreeCache 缓存是一个共享资源,它有可能被多个持久性单元使用。共享缓存里的条目需要进行正确分组,这样缓存才能正确地管理类的加载。<"
+"property name=\"hibernate.cache.region_prefix\" value=\"myprefix\"/>"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:97
@@ -523,23 +526,24 @@
"prefix. This is not a particularly friendly region prefix if you need to use "
"it to set up specialized eviction regions (see below), so specifying your "
"own region prefix is recommended."
-msgstr ""
+msgstr "如果你没有提供 region 前缀,JBoss 将自动提供一个根据 EAR(如果有)和包含 persistence.xml 的 JAR 文件的前缀。例如, foo.ear 和 bar.jar 里的 persistence.xml 将被赋予前缀“foo_ear,bar_jar”。如果你需要用它来设立特殊的逐出 region,这不是一个特别友好的 region 前缀,所以我们推荐你使用自己的 region 前缀。"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:105
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"Next we need to configure what entities be cached. The default is to not "
"cache anything, even with the settings shown above. We use the <literal>@org."
"hibernate.annotations.Cache</literal> annotation to tag entity beans that "
"needs to be cached."
msgstr ""
-"下一步我们需要配置 entities 被缓存的内容。就像上面所展示的样,缺省是什么都不"
-"缓存。我们使用 <literal>@Cache</literal> 注解来标记需要缓存的 entity beans。"
+"下一步我们需要配置哪些实体被缓存。就像上面所展示的样,缺省是什么都不"
+"缓存。我们使用 <literal>@org."
+"hibernate.annotations.Cache</literal> 注解来标记需要缓存的 entity bean。"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:106
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"@Entity \n"
"@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL) \n"
@@ -548,14 +552,14 @@
"}"
msgstr ""
"@Entity \n"
-"@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL) \n"
-"public class Customer implements Serializable { \n"
+"@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL) \n"
+"public class Account implements Serializable { \n"
" // ... ... \n"
"}"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:107
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"A very simplified rule of thumb is that you will typically want to do "
"caching for objects that rarely change, and which are frequently read. You "
@@ -573,12 +577,13 @@
"<literal>ejb3-entity-cache-service.xml</literal> 配置文件里为每个 entity "
"bean 微调缓存设置。例如,你可以指定缓存的大小。如果缓存里的对象太多,缓存有可"
"能挤掉最老的对象(或者最少用的对象,依你的配置而定)来给新对象留出空间。"
-"<literal>mycompany.Customer</literal> entity bean 的缓存区(cache region)是 "
-"<literal>/mycompany/Customer</literal>。"
+"假设 <literal>persistence.xml</literal> 里指定的 region_prefix 是 myprefix,entity bean 的<literal>com.mycompany.entities.Account</"
+"literal> 缺省的缓存 region 是 <literal>/myprefix/com/mycompany/entities/Account</"
+"literal>。"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:109
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[\n"
"<server> \n"
@@ -609,35 +614,38 @@
" </mbean> \n"
"</server>]]>"
msgstr ""
-"<server> \n"
-" <mbean code=\"org.jboss.cache.TreeCache\" \n"
-" name=\"jboss.cache:service=EJB3EntityTreeCache\"> \n"
-" <depends>jboss:service=Naming \n"
-" <depends>jboss:service=TransactionManager \n"
-" ... ... \n"
-" <attribute name=\"EvictionPolicyConfig\"> \n"
-" <config> \n"
-" <attribute name=\"wakeUpIntervalSeconds\">5</"
-"attribute> \n"
-" <region name=\"/_default_\"> \n"
-" <attribute name=\"maxNodes\">5000</attribute> \n"
-" <attribute name=\"timeToLiveSeconds\">1000</"
-"attribute> \n"
-" </region> \n"
-" <region name=\"/mycompany/Customer\"> \n"
-" <attribute name=\"maxNodes\">10</attribute> \n"
-" <attribute name=\"timeToLiveSeconds\">5000</"
-"attribute> \n"
-" </region> \n"
-" ... ... \n"
-" </config> \n"
-" </attribute> \n"
-" </mbean> \n"
-"</server>"
+"<![CDATA[\n"
+"<server> \n"
+" <mbean code=\"org.jboss.cache.TreeCache\" \n"
+" name=\"jboss.cache:service=EJB3EntityTreeCache\"> \n"
+" ... ... \n"
+" <attribute name=\"EvictionPolicyConfig\"> \n"
+" <config> \n"
+" <attribute name=\"wakeUpIntervalSeconds\">5</"
+"attribute> \n"
+" <region name=\"/_default_\"> \n"
+" <attribute name=\"maxNodes\">5000</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">1000</attribute> \n"
+" </region> \n"
+" <!-- Separate eviction rules for Account entities -->\n"
+" <region name=\"/myprefix/com/mycompany/entities/"
+"Account\"> \n"
+" <attribute name=\"maxNodes\">10000</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">5000</attribute> \n"
+" </region> \n"
+" ... ... \n"
+" </config> \n"
+" </attribute> \n"
+" </mbean> \n"
+"</server>]]>"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:112
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"If you do not specify a cache region for an entity bean class, all instances "
"of this class will be cached in the <literal>/_default</literal> region as "
@@ -647,13 +655,11 @@
"class name of the entity class."
msgstr ""
"如果你没有为 entity bean 类指定缓存区(cache region),这个类的所有实例将象上"
-"面定义的一样缓存在 <literal>/_default</literal> 区里。EJB3 <literal>Query</"
-"literal> API 提供了让你在指定的缓存区里保存或载入查询结果(就是 entity beans "
-"的集合)的方法。"
+"面定义的一样缓存在 <literal>/_default</literal> 区里。@Cache 注解开放一个可选的属性“region”,它让你指定实体所存储的缓存区,而不是根据实体类的全限定名自动创建。"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:115
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"@Entity \n"
"@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL,\n"
@@ -663,20 +669,21 @@
"}"
msgstr ""
"@Entity \n"
-"@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL) \n"
-"public class Customer implements Serializable { \n"
-" // ... ... \n"
+"@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL,\n"
+"region=”Account”) \n"
+"public class Account implements Serializable { \n"
+"// ... ... \n"
"}"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:116
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The eviction configuration would then become:"
-msgstr "EJB 应用程序配置"
+msgstr "逐出配置将是:"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:117
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[ \n"
"<server> \n"
@@ -703,37 +710,36 @@
" </mbean> \n"
"</server>]]>"
msgstr ""
-"<server> \n"
-" <mbean code=\"org.jboss.cache.TreeCache\" \n"
-" name=\"jboss.cache:service=EJB3EntityTreeCache\"> \n"
-" <depends>jboss:service=Naming \n"
-" <depends>jboss:service=TransactionManager \n"
-" ... ... \n"
-" <attribute name=\"EvictionPolicyConfig\"> \n"
-" <config> \n"
-" <attribute name=\"wakeUpIntervalSeconds\">5</"
-"attribute> \n"
-" <region name=\"/_default_\"> \n"
-" <attribute name=\"maxNodes\">5000</attribute> \n"
-" <attribute name=\"timeToLiveSeconds\">1000</"
-"attribute> \n"
-" </region> \n"
-" <region name=\"/mycompany/Customer\"> \n"
-" <attribute name=\"maxNodes\">10</attribute> \n"
-" <attribute name=\"timeToLiveSeconds\">5000</"
-"attribute> \n"
-" </region> \n"
-" ... ... \n"
-" </config> \n"
-" </attribute> \n"
-" </mbean> \n"
-"</server>"
+"<![CDATA[ \n"
+"<server> \n"
+" <mbean code=\"org.jboss.cache.TreeCache\" \n"
+" name=\"jboss.cache:service=EJB3EntityTreeCache\"> \n"
+" ... ... \n"
+" <attribute name=\"EvictionPolicyConfig\"> \n"
+" <config> \n"
+" <attribute name=\"wakeUpIntervalSeconds\">5</attribute> \n"
+" <region name=\"/_default_\"> \n"
+" <attribute name=\"maxNodes\">5000</attribute> \n"
+" <attribute name=\"timeToLiveSeconds\">1000</attribute> \n"
+" </region> \n"
+" <!-- Separate eviction rules for Account entities -->\n"
+" <region name=\"/myprefix/Account\"> \n"
+" <attribute name=\"maxNodes\">10000</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds\">5000</"
+"attribute> \n"
+" </region> \n"
+" ... ... \n"
+" </config> \n"
+" </attribute> \n"
+" </mbean> \n"
+"</server>]]>"
#. Tag: title
#: Clustering_Guide_Entity_EJBs.xml:122
#, no-c-format
msgid "Query result caching"
-msgstr ""
+msgstr "查询结果的缓存"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:123
@@ -744,21 +750,19 @@
"collections of scalar values) of specified queries. Here we show a simple "
"example of annotating a bean with a named query, also providing the "
"Hibernate-specific hints that tells Hibernate to cache the query."
-msgstr ""
+msgstr "EJB3 Query API 也为你提供了把查询结果(如 entity bean 的主键集合或标量结果的集合)保存在二级缓存里的方法。在这里我们演示了一个简单的例子,它注解了带有命名查询的 bean,且提供 Hibernate 专有的指令来让 Hibernate 缓存这个查询。"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:126
#, no-c-format
-msgid ""
-"First, in persistence.xml you need to tell Hibernate to enable query caching:"
-msgstr ""
+msgid "First, in persistence.xml you need to tell Hibernate to enable query caching:"
+msgstr "首先,在 persistence.xml 里,你需要告诉 Hibernate 启用查询缓存:"
#. Tag: screen
#: Clustering_Guide_Entity_EJBs.xml:129
#, no-c-format
-msgid ""
-"<property name=\"hibernate.cache.use_query_cache\" value=\"true\"/>"
-msgstr ""
+msgid "<property name=\"hibernate.cache.use_query_cache\" value=\"true\"/>"
+msgstr "<property name=\"hibernate.cache.use_query_cache\" value=\"true\"/>"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:130
@@ -766,7 +770,7 @@
msgid ""
"Next, you create a named query associated with an entity, and tell Hibernate "
"you want to cache the results of that query:"
-msgstr ""
+msgstr "然后,你创建和实体相关的命名查询,并告诉 Hibernate 你要缓存该查询的结果。"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:133
@@ -786,6 +790,19 @@
"// ... ... \n"
"}]]>"
msgstr ""
+"<![CDATA[ \n"
+"@Entity\n"
+"@Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL,\n"
+"region=”Account”)\n"
+"@NamedQueries({\n"
+"@NamedQuery(name=\"account.bybranch\",\n"
+"query=\"select acct from Account as acct where acct.branch = ?1\",\n"
+"hints={@QueryHint(name=\"org.hibernate.cacheable\",value=\"true"
+"\")}) \n"
+"})\n"
+"public class Account implements Serializable { \n"
+"// ... ... \n"
+"}]]>"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:135
@@ -794,7 +811,7 @@
"The @NamedQueries, @NamedQuery and @QueryHint annotations are all in the "
"javax.persistence package.See the Hibernate and EJB3 documentation for more "
"on how to use EJB3 queries and on how to instruct EJB3 to cache queries."
-msgstr ""
+msgstr "@NamedQueries, @NamedQuery and @QueryHint 注解都在 javax.persistence 包里。关于如何使用 EJB3 查询以及缓存查询结果的更多信息,请参考 Hibernate 和 EJB3 的文档。"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:138
@@ -805,7 +822,7 @@
"can set up separate eviction handling for your query results. So, if the "
"region prefix were set to myprefix in persistence.xml, you could, for "
"example, create this sort of eviction handling:"
-msgstr ""
+msgstr "在缺省情况下,Hibernate 把查询结果存储在 JBoss Cache 的名为 {region_prefix}/org/hibernate/cache/StandardQueryCache 区里。基于此点,你可以为查询结果设立单独的逐出处理过程。所以,如果在 persistence.xml 里把区前缀设置为 myprefix,你可以创建这样的逐出处理过程:"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:142
@@ -849,6 +866,43 @@
"</server>\n"
" ]]>"
msgstr ""
+"<![CDATA[ \n"
+"<server> \n"
+" <mbean code=\"org.jboss.cache.TreeCache\" \n"
+" name=\"jboss.cache:service=EJB3EntityTreeCache\">\n"
+" ... ... \n"
+" <attribute name=\"EvictionPolicyConfig\"> \n"
+" <config> \n"
+" <attribute name=\"wakeUpIntervalSeconds\">5</"
+"attribute> \n"
+" <region name=\"/_default_\"> \n"
+" <attribute name=\"maxNodes\">5000</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">1000</attribute> \n"
+" </region> \n"
+" <!-- Separate eviction rules for Account "
+"entities -->\n"
+" <region name=\"/myprefix/Account\"> \n"
+" <attribute name=\"maxNodes"
+"\">10000</attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">5000</attribute> \n"
+" </region>\n"
+" <!-- Cache queries for 10 minutes -->\n"
+" <region name=\"/myprefix/org/hibernate/"
+"cache/StandardQueryCache\"> \n"
+" <attribute name=\"maxNodes\">100</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">600</attribute> \n"
+" </region> \n"
+" ... ... \n"
+" </config> \n"
+" </attribute> \n"
+" </mbean> \n"
+"</server>\n"
+" ]]>"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:144
@@ -860,6 +914,8 @@
"use instead ofthe default /org/hibernate/cache/StandardQueryCache. For "
"example:"
msgstr ""
+"上面的 @NamedQuery.hints 采用一个供应商专有的 @QueryHints 队列。Hibernate 接受“org.hibernate."
+"cacheRegion”,它的值是所使用的缓存区的名称,而不是缺省的 /org/hibernate/cache/StandardQueryCache。例如:"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:147
@@ -880,12 +936,26 @@
" // ... ... \n"
" }]]>"
msgstr ""
+"<![CDATA[\n"
+" @Entity\n"
+" @Cache (usage=CacheConcurrencyStrategy.TRANSACTIONAL,\n"
+" region=”Account”)\n"
+" @NamedQueries({\n"
+" @NamedQuery(name=\"account.bybranch\",\n"
+" query=\"select acct from Account as acct where acct.branch = ?1\",\n"
+" hints={@QueryHint(name=\"org.hibernate.cacheable\",value=\"true\"),\n"
+" @QueryHint(name=”org.hibernate.cacheRegion,value=”Queries”)\n"
+" }) \n"
+" })\n"
+" public class Account implements Serializable { \n"
+" // ... ... \n"
+" }]]>"
#. Tag: para
#: Clustering_Guide_Entity_EJBs.xml:148
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The related eviction configuration:"
-msgstr "EJB 应用程序配置"
+msgstr "相关的逐出配置:"
#. Tag: programlisting
#: Clustering_Guide_Entity_EJBs.xml:151
@@ -927,3 +997,39 @@
" </mbean> \n"
"</server>]]>"
msgstr ""
+"<![CDATA[ \n"
+"<server> \n"
+" <mbean code=\"org.jboss.cache.TreeCache\" \n"
+" name=\"jboss.cache:service=EJB3EntityTreeCache\">\n"
+" ... ... \n"
+" <attribute name=\"EvictionPolicyConfig\"> \n"
+" <config> \n"
+" <attribute name=\"wakeUpIntervalSeconds\">5</"
+"attribute> \n"
+" <region name=\"/_default_\"> \n"
+" <attribute name=\"maxNodes\">5000</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">1000</attribute> \n"
+" </region> \n"
+" <!-- Separate eviction rules for Account "
+"entities -->\n"
+" <region name=\"/myprefix/Account\"> \n"
+" <attribute name=\"maxNodes\">10000</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">5000</attribute> \n"
+" </region>\n"
+" <!-- Cache queries for 10 minutes -->\n"
+" <region name=\"/myprefix/Queries\"> \n"
+" <attribute name=\"maxNodes\">100</"
+"attribute> \n"
+" <attribute name=\"timeToLiveSeconds"
+"\">600</attribute> \n"
+" </region> \n"
+" ... ... \n"
+" </config> \n"
+" </attribute> \n"
+" </mbean> \n"
+"</server>]]>"
+
More information about the jboss-cvs-commits
mailing list