[jboss-svn-commits] JBL Code SVN: r23610 - labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 28 22:49:06 EDT 2008
Author: xhuang at jboss.com
Date: 2008-10-28 22:49:06 -0400 (Tue, 28 Oct 2008)
New Revision: 23610
Modified:
labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Configuring_JBossJTA.po
labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Examples.po
labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/JDBC_and_Transactions.po
Log:
update
Modified: labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Configuring_JBossJTA.po
===================================================================
--- labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Configuring_JBossJTA.po 2008-10-28 13:27:16 UTC (rev 23609)
+++ labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Configuring_JBossJTA.po 2008-10-29 02:49:06 UTC (rev 23610)
@@ -1,3 +1,4 @@
+# translation of Configuring_JBossJTA.po to
# Language zh-CN translations for package.
# Automatically generated, 2008.
#
@@ -3,25 +4,26 @@
msgid ""
msgstr ""
-"Project-Id-Version: \n"
+"Project-Id-Version: Configuring_JBossJTA\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-09-23 06:25+0000\n"
-"PO-Revision-Date: 2008-09-23 06:25+0000\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2008-10-29 12:34+1000\n"
+"Last-Translator: \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
#: Configuring_JBossJTA.xml:6
#, no-c-format
msgid "Configuring JBossJTA"
-msgstr ""
+msgstr "配置 JBossJTA"
#. Tag: title
#: Configuring_JBossJTA.xml:8
#, no-c-format
msgid "Configuring options"
-msgstr ""
+msgstr "配置选项"
#. Tag: para
@@ -32,49 +34,49 @@
"The following table shows the configuration features, with default values "
"shown in italics. For more detailed information, the relevant section "
"numbers are provided."
-msgstr ""
+msgstr "下表显示了配置特性,其中斜体为缺省值。更多的信息,请参考相关章节号指明的章节。"
#. Tag: title
#: Configuring_JBossJTA.xml:13
#, no-c-format
msgid "JBossJTA configuration options."
-msgstr ""
+msgstr "JBossJTA 配置选项。"
#. Tag: entry
#: Configuring_JBossJTA.xml:17
#, no-c-format
msgid "Configuration Name"
-msgstr ""
+msgstr "配置名称"
#. Tag: entry
#: Configuring_JBossJTA.xml:20
#, no-c-format
msgid "Possibile Values"
-msgstr ""
+msgstr "可选值"
#. Tag: entry
#: Configuring_JBossJTA.xml:23
#, no-c-format
msgid "Relevant Section"
-msgstr ""
+msgstr "相关章节"
#. Tag: entry
#: Configuring_JBossJTA.xml:30
#, no-c-format
msgid "com.arjuna.ats.jta.supportSubtransactions"
-msgstr ""
+msgstr "com.arjuna.ats.jta.supportSubtransactions"
#. Tag: entry
#: Configuring_JBossJTA.xml:33
#, no-c-format
msgid "YES/NO"
-msgstr ""
+msgstr "YES/NO"
#. Tag: entry
#: Configuring_JBossJTA.xml:40
#, no-c-format
msgid "com.arjuna.ats.jta.jtaTMImplementation"
-msgstr ""
+msgstr "com.arjuna.ats.jta.jtaTMImplementation"
#. Tag: entry
#: Configuring_JBossJTA.xml:43
@@ -83,12 +85,14 @@
"com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple/"
"com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple"
msgstr ""
+"com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple/"
+"com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple"
#. Tag: entry
#: Configuring_JBossJTA.xml:50
#, no-c-format
msgid "com.arjuna.ats.jta.jtaUTImplementation"
-msgstr ""
+msgstr "com.arjuna.ats.jta.jtaUTImplementation"
#. Tag: entry
#: Configuring_JBossJTA.xml:53
@@ -97,39 +101,42 @@
"com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple/com."
"arjuna.ats.internal.jta.transaction.jts.UserTransactionImple"
msgstr ""
+"com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple/com."
+"arjuna.ats.internal.jta.transaction.jts.UserTransactionImple"
#. Tag: entry
#: Configuring_JBossJTA.xml:60
#, no-c-format
msgid "com.arjuna.ats.jta.xaBackoffPeriod"
-msgstr ""
+msgstr "com.arjuna.ats.jta.xaBackoffPeriod"
#. Tag: entry
#: Configuring_JBossJTA.xml:69
#, no-c-format
msgid "com.arjuna.ats.jdbc.isolationLevel"
-msgstr ""
+msgstr "com.arjuna.ats.jdbc.isolationLevel"
#. Tag: entry
#: Configuring_JBossJTA.xml:72
#, no-c-format
msgid "Any supported JDBC isolation level."
-msgstr ""
+msgstr "所支持的任何 JDBC 隔离级别。"
#. Tag: entry
#: Configuring_JBossJTA.xml:79
#, no-c-format
msgid "com.arjuna.ats.jta.xaTransactionTimetouEnabled"
-msgstr ""
+msgstr "com.arjuna.ats.jta.xaTransactionTimetouEnabled"
#. Tag: entry
#: Configuring_JBossJTA.xml:82
#, no-c-format
msgid "true/false"
-msgstr ""
+msgstr "true/false"
#. Tag: entry
#: Configuring_JBossJTA.xml:85
#, no-c-format
msgid "Chapter 3"
-msgstr ""
+msgstr "第 3 章"
+
Modified: labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Examples.po
===================================================================
--- labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Examples.po 2008-10-28 13:27:16 UTC (rev 23609)
+++ labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/Examples.po 2008-10-29 02:49:06 UTC (rev 23610)
@@ -1,3 +1,4 @@
+# translation of Examples.po to
# Language zh-CN translations for package.
# Automatically generated, 2008.
#
@@ -3,25 +4,26 @@
msgid ""
msgstr ""
-"Project-Id-Version: \n"
+"Project-Id-Version: Examples\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-09-23 06:25+0000\n"
-"PO-Revision-Date: 2008-09-23 06:25+0000\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
+"PO-Revision-Date: 2008-10-29 12:48+1000\n"
+"Last-Translator: \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
#: Examples.xml:6
#, no-c-format
msgid "Examples"
-msgstr ""
+msgstr "示例"
#. Tag: title
#: Examples.xml:8
#, no-c-format
msgid "JDBC example"
-msgstr ""
+msgstr "JDBC 示例"
#. Tag: para
@@ -34,7 +36,7 @@
"assumes that you are using the transactional JDBC driver provided with "
"JBossTS. For details about how to configure and use this driver see the "
"previous Chapter."
-msgstr ""
+msgstr "下面的代码解释了上述的大部分要点(为简单起见,我们删除了许多错误检查代码)。这个例子假设你使用的是 JBossTS 提供的事务性 JDBC 驱动。关于如何配置和使用这些驱动的细节,请参考前一章的内容。"
#. Tag: screen
#: Examples.xml:12
@@ -197,12 +199,168 @@
" }\n"
"}"
msgstr ""
+"public class JDBCTest\n"
+"{\n"
+"public static void main (String[] args)\n"
+"{\n"
+" /*\n"
+" */\n"
+" \n"
+" Connection conn = null;\n"
+" Connection conn2 = null;\n"
+" Statement stmt = null; // non-tx statement\n"
+" Statement stmtx = null; // will be a tx-statement\n"
+" Properties dbProperties = new Properties();\n"
+" \n"
+" try\n"
+" {\n"
+" System.out.println(\"\\nCreating connection to database: "
+"\"+url);\n"
+" \n"
+" /*\n"
+" * Create conn and conn2 so that they are bound to the "
+"JBossTS\n"
+" * transactional JDBC driver. The details of how to do this "
+"will\n"
+" * depend on your environment, the database you wish to use "
+"and\n"
+" * whether or not you want to use the Direct or JNDI "
+"approach. See\n"
+" * the appropriate chapter in the JTA Programmers Guide.\n"
+" */\n"
+" \n"
+" stmt = conn.createStatement(); // non-tx statement\n"
+" \n"
+" try\n"
+" {\n"
+" stmt.executeUpdate(\"DROP TABLE test_table\");\n"
+" stmt.executeUpdate(\"DROP TABLE test_table2\");\n"
+" }\n"
+" catch (Exception e)\n"
+" {\n"
+" // assume not in database.\n"
+" }\n"
+" \n"
+" try\n"
+" {\n"
+" stmt.executeUpdate(\"CREATE TABLE test_table (a "
+"INTEGER,b INTEGER)\");\n"
+" stmt.executeUpdate(\"CREATE TABLE test_table2 (a "
+"INTEGER,b INTEGER)\");\n"
+" }\n"
+" catch (Exception e)\n"
+" {\n"
+" }\n"
+" \n"
+" try\n"
+" {\n"
+" System.out.println(\"Starting top-level transaction."
+"\");\n"
+" \n"
+" com.arjuna.ats.jta.UserTransaction.userTransaction()."
+"begin();\n"
+" \n"
+" stmtx = conn.createStatement(); // will be a tx-"
+"statement\n"
+" \n"
+" System.out.println(\"\\nAdding entries to table 1."
+"\");\n"
+" \n"
+" stmtx.executeUpdate(\"INSERT INTO test_table (a, b) "
+"VALUES (1,2)\");\n"
+" \n"
+" ResultSet res1 = null;\n"
+" \n"
+" System.out.println(\"\\nInspecting table 1.\");\n"
+" \n"
+" res1 = stmtx.executeQuery(\"SELECT * FROM test_table"
+"\");\n"
+" while (res1.next())\n"
+" {\n"
+" System.out.println(\"Column 1: \"+res1.getInt"
+"(1));\n"
+" System.out.println(\"Column 2: \"+res1.getInt"
+"(2));\n"
+" }\n"
+" \n"
+" System.out.println(\"\\nAdding entries to table 2."
+"\");\n"
+" \n"
+" stmtx.executeUpdate(\"INSERT INTO test_table2 (a, b) "
+"VALUES (3,4)\");\n"
+" \n"
+" res1 = stmtx.executeQuery(\"SELECT * FROM test_table2"
+"\");\n"
+" \n"
+" System.out.println(\"\\nInspecting table 2.\");\n"
+" \n"
+" while (res1.next())\n"
+" {\n"
+" System.out.println(\"Column 1: \"+res1.getInt"
+"(1));\n"
+" System.out.println(\"Column 2: \"+res1.getInt"
+"(2));\n"
+" }\n"
+" System.out.print(\"\\nNow attempting to rollback "
+"changes.\");\n"
+" \n"
+" com.arjuna.ats.jta.UserTransaction.userTransaction()."
+"rollback();\n"
+" \n"
+" com.arjuna.ats.jta.UserTransaction.userTransaction()."
+"begin();\n"
+" \n"
+" stmtx = conn.createStatement();\n"
+" ResultSet res2 = null;\n"
+" \n"
+" System.out.println(\"\\nNow checking state of table "
+"1.\");\n"
+" \n"
+" res2 = stmtx.executeQuery(\"SELECT * FROM test_table"
+"\");\n"
+" while (res2.next())\n"
+" {\n"
+" System.out.println(\"Column 1: \"+res2.getInt"
+"(1));\n"
+" System.out.println(\"Column 2: \"+res2.getInt"
+"(2));\n"
+" }\n"
+" \n"
+" System.out.println(\"\\nNow checking state of table "
+"2.\");\n"
+" \n"
+" stmtx = conn.createStatement();\n"
+" res2 = stmtx.executeQuery(\"SELECT * FROM test_table2"
+"\");\n"
+" while (res2.next())\n"
+" {\n"
+" System.out.println(\"Column 1: \"+res2.getInt"
+"(1));\n"
+" System.out.println(\"Column 2: \"+res2.getInt"
+"(2));\n"
+" }\n"
+" \n"
+" com.arjuna.ats.jta.UserTransaction.userTransaction()."
+"commit(true);\n"
+" }\n"
+" catch (Exception ex)\n"
+" {\n"
+" ex.printStackTrace();\n"
+" System.exit(0);\n"
+" }\n"
+" }\n"
+" catch (Exception sysEx)\n"
+" {\n"
+" sysEx.printStackTrace();\n"
+" System.exit(0);\n"
+" }\n"
+"}"
#. Tag: title
#: Examples.xml:16
#, no-c-format
msgid "Failure recovery example"
-msgstr ""
+msgstr "失效切换示例"
#. Tag: para
#: Examples.xml:17
@@ -215,7 +373,7 @@
"file in which the db connection information is specified, as well as the "
"number of connections that this file contains information on (separated "
"by ;)."
-msgstr ""
+msgstr "这个类实现了 <code>XAResources</code> 的 <interfacename>XAResourceRecovery</interfacename> 接口。setParameters 提供的参数可以包含初始化类的任何信息。在这个例子里,它包含指定了数据库连接信息的属性文件的名称,以及这个文件的信息涉及的连接的序号(以 ; 隔开)。"
#. Tag: para
#: Examples.xml:21
@@ -228,7 +386,7 @@
"can perform recovery on them. It is not recommended that information such as "
"user name and password appear in such a raw text format as it opens up a "
"potential security hole."
-msgstr ""
+msgstr "<code>XAResourceRecovery</code> 实现执行只是一些<emphasis>示例</emphasis>功能。它使用一个包含重新创建在正常运行时的连接所需的足够信息的属性文件,这样我们就可以根据它执行切换。我们不推荐在这样一个明码文本文件里出现用户名和密码等信息,因为这可能导致安全漏洞。"
#. Tag: para
#: Examples.xml:25
@@ -236,37 +394,37 @@
msgid ""
"The db parameters specified in the property file are assumed to be in the "
"format:"
-msgstr ""
+msgstr "我们假定属性文件里指定的数据库参数具有下列的格式:"
#. Tag: para
#: Examples.xml:30
#, no-c-format
msgid "DB_x_DatabaseURL="
-msgstr ""
+msgstr "DB_x_DatabaseURL="
#. Tag: para
#: Examples.xml:35
#, no-c-format
msgid "DB_x_DatabaseUser="
-msgstr ""
+msgstr "DB_x_DatabaseUser="
#. Tag: para
#: Examples.xml:40
#, no-c-format
msgid "DB_x_DatabasePassword="
-msgstr ""
+msgstr "DB_x_DatabasePassword="
#. Tag: para
#: Examples.xml:45
#, no-c-format
msgid "DB_x_DatabaseDynamicClass="
-msgstr ""
+msgstr "DB_x_DatabaseDynamicClass="
#. Tag: para
#: Examples.xml:50
#, no-c-format
msgid "Where x is the number of the connection information."
-msgstr ""
+msgstr "这里的 x 是连接信息的序号。"
#. Tag: para
#: Examples.xml:54
@@ -274,7 +432,7 @@
msgid ""
"Some error handling code has been removed from this text for ease of "
"readability purposes."
-msgstr ""
+msgstr "出于易读性考虑,我们删除了一些错误处理代码。"
#. Tag: screen
#: Examples.xml:58
@@ -458,6 +616,183 @@
" private static final char BREAKCHARACTER = ';'; // delimiter for "
"parameters"
msgstr ""
+"/*\n"
+" * Some XAResourceRecovery implementations will do their startup work here,\n"
+" * and then do little or nothing in setDetails. Since this one needs to "
+"know\n"
+" * dynamic class name, the constructor does nothing.\n"
+" */\n"
+" \n"
+"public BasicXARecovery () throws SQLException\n"
+"{\n"
+" numberOfConnections = 1;\n"
+" connectionIndex = 0;\n"
+" props = null;\n"
+"}\n"
+" \n"
+"/*\n"
+" * The recovery module will have chopped off this class name already. The\n"
+" * parameter should specify a property file from which the url, user name,\n"
+" * password, etc. can be read.\n"
+" * \n"
+" * @message com.arjuna.ats.internal.jdbc.recovery.initexp An exception\n"
+" * occurred during initialisation.\n"
+" */\n"
+" \n"
+"public boolean initialise (String parameter) throws SQLException\n"
+"{\n"
+" if (parameter == null) \n"
+" return true;\n"
+" \n"
+" int breakPosition = parameter.indexOf(BREAKCHARACTER);\n"
+" String fileName = parameter;\n"
+" \n"
+" if (breakPosition != -1)\n"
+" {\n"
+" fileName = parameter.substring(0, breakPosition - 1);\n"
+" \n"
+" try\n"
+" {\n"
+" numberOfConnections = Integer.parseInt(parameter."
+"substring(breakPosition + 1));\n"
+" }\n"
+" catch (NumberFormatException e)\n"
+" {\n"
+" return false;\n"
+" }\n"
+" }\n"
+" \n"
+" try\n"
+" {\n"
+" String uri = com.arjuna.common.util.FileLocator.locateFile"
+"(fileName);\n"
+" jdbcPropertyManager.propertyManager.load(XMLFilePlugin.class."
+"getName(), uri);\n"
+" \n"
+" props = jdbcPropertyManager.propertyManager.getProperties"
+"();\n"
+" }\n"
+" catch (Exception e)\n"
+" {\n"
+" return false;\n"
+" }\n"
+" \n"
+" return true;\n"
+"}\n"
+" \n"
+"/*\n"
+" * @message com.arjuna.ats.internal.jdbc.recovery.xarec {0} could not find\n"
+" * information for connection!\n"
+" */\n"
+" \n"
+"public synchronized XAResource getXAResource () throws SQLException\n"
+"{\n"
+" JDBC2RecoveryConnection conn = null;\n"
+" \n"
+" if (hasMoreResources())\n"
+" {\n"
+" connectionIndex++;\n"
+" \n"
+" conn = getStandardConnection();\n"
+" \n"
+" if (conn == null) conn = getJNDIConnection();\n"
+" }\n"
+" \n"
+" return conn.recoveryConnection().getConnection()."
+"getXAResource();\n"
+"}\n"
+" \n"
+"public synchronized boolean hasMoreResources ()\n"
+"{\n"
+" if (connectionIndex == numberOfConnections) \n"
+" return false;\n"
+" else\n"
+" return true;\n"
+"}\n"
+" \n"
+"private final JDBC2RecoveryConnection getStandardConnection ()\n"
+" throws SQLException\n"
+"{\n"
+" String number = new String(\"\" + connectionIndex);\n"
+" String url = new String(dbTag + number + urlTag);\n"
+" String password = new String(dbTag + number + passwordTag);\n"
+" String user = new String(dbTag + number + userTag);\n"
+" String dynamicClass = new String(dbTag + number + dynamicClassTag);\n"
+" \n"
+" Properties dbProperties = new Properties();\n"
+" \n"
+" String theUser = props.getProperty(user);\n"
+" String thePassword = props.getProperty(password);\n"
+" \n"
+" if (theUser != null)\n"
+" {\n"
+" dbProperties.put(TransactionalDriver.userName, theUser);\n"
+" dbProperties.put(TransactionalDriver.password, "
+"thePassword);\n"
+" \n"
+" String dc = props.getProperty(dynamicClass);\n"
+" \n"
+" if (dc != null)\n"
+" dbProperties.put(TransactionalDriver.dynamicClass, "
+"dc);\n"
+" \n"
+" return new JDBC2RecoveryConnection(url, dbProperties);\n"
+" }\n"
+" else\n"
+" return null;\n"
+"}\n"
+" \n"
+"private final JDBC2RecoveryConnection getJNDIConnection ()\n"
+" throws SQLException\n"
+"{\n"
+" String number = new String(\"\" + connectionIndex);\n"
+" String url = new String(dbTag + jndiTag + number + urlTag);\n"
+" String password = new String(dbTag + jndiTag + number + "
+"passwordTag);\n"
+" String user = new String(dbTag + jndiTag + number + userTag);\n"
+" \n"
+" Properties dbProperties = new Properties();\n"
+" \n"
+" String theUser = props.getProperty(user);\n"
+" String thePassword = props.getProperty(password);\n"
+" \n"
+" if (theUser != null)\n"
+" {\n"
+" dbProperties.put(TransactionalDriver.userName, theUser);\n"
+" dbProperties.put(TransactionalDriver.password, "
+"thePassword);\n"
+" \n"
+" return new JDBC2RecoveryConnection(url, dbProperties);\n"
+" }\n"
+" else\n"
+" return null;\n"
+"}\n"
+" \n"
+"private int numberOfConnections;\n"
+"private int connectionIndex;\n"
+"private Properties props;\n"
+"private static final String dbTag = \"DB_\";\n"
+"private static final String urlTag = \"_DatabaseURL\";\n"
+"private static final String passwordTag = \"_DatabasePassword\";\n"
+"private static final String userTag = \"_DatabaseUser\";\n"
+"private static final String dynamicClassTag = \"_DatabaseDynamicClass\";\n"
+"private static final String jndiTag = \"JNDI_\";\n"
+" \n"
+"/*\n"
+" * Example:\n"
+" * \n"
+" * DB2_DatabaseURL=jdbc\\:arjuna\\:sequelink\\://qa02\\:20001\n"
+" * DB2_DatabaseUser=tester2 DB2_DatabasePassword=tester\n"
+" * DB2_DatabaseDynamicClass=com.arjuna.ats.internal.jdbc.drivers."
+"sequelink_5_1\n"
+" * \n"
+" * DB_JNDI_DatabaseURL=jdbc\\:arjuna\\:jndi DB_JNDI_DatabaseUser=tester1\n"
+" * DB_JNDI_DatabasePassword=tester DB_JNDI_DatabaseName=empay\n"
+" * DB_JNDI_Host=qa02 DB_JNDI_Port=20000\n"
+" */\n"
+"\n"
+" private static final char BREAKCHARACTER = ';'; // delimiter for "
+"parameters"
#. Tag: para
#: Examples.xml:59
@@ -468,3 +803,6 @@
"to the database using the same parameters that were used to create the "
"initial connection."
msgstr ""
+"<classname>com.arjuna.ats.internal.jdbc.recovery."
+"JDBC2RecoveryConnection</classname> 类可根据创建初始连接的参数创建新的连接。"
+
Modified: labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/JDBC_and_Transactions.po
===================================================================
--- labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/JDBC_and_Transactions.po 2008-10-28 13:27:16 UTC (rev 23609)
+++ labs/jbosstm/enterprise/tags/EAP_4_3_0/Transactions_JTA_Programmers_Guide/zh-CN/JDBC_and_Transactions.po 2008-10-29 02:49:06 UTC (rev 23610)
@@ -8,8 +8,8 @@
"Project-Id-Version: JDBC_and_Transactions\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-09-23 06:25+0000\n"
-"PO-Revision-Date: 2008-10-28 13:04+1000\n"
-"Last-Translator: Xi HUANG <xhuang at redhat.com>\n"
+"PO-Revision-Date: 2008-10-29 11:50+1000\n"
+"Last-Translator: \n"
"Language-Team: <en at li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -101,13 +101,13 @@
"indirect transaction management must be used by applications, i.e., for each "
"JDBC connection it must be possible for JBossJTA to determine the invoking "
"thread’s current transaction context."
-msgstr ""
+msgstr "JBossJTA 必须能够将在 JDBC 连接上进行的操作和特定的事务相关联。因此,应用程序必须使用隐性的事务传递和/或间接的事务管理,那就是说,对于每个 JDBC 连接,JBossJTA 都必须能够获得调用线程的当前事务上下文。"
#. Tag: title
#: JDBC_and_Transactions.xml:52
#, no-c-format
msgid "Restrictions"
-msgstr ""
+msgstr "限制"
#. Tag: para
#: JDBC_and_Transactions.xml:53
@@ -116,7 +116,7 @@
"The following restrictions are imposed by limitations in the JDBC "
"specifications and by JBossJTA to ensure that transactional interactions "
"with JDBC databases can be correctly managed:"
-msgstr ""
+msgstr "JDBC 规格和 JBossJTA 强加了下列的限制来确保正确管理和 JDBC 数据库的事务性交互。"
#. Tag: para
#: JDBC_and_Transactions.xml:57
@@ -128,16 +128,19 @@
"if you wish to have nested transactions, then you can set the <property>com."
"arjuna.ats.jta.supportSubtransactions</property> property to YES."
msgstr ""
+"JDBC 2.0 不支持嵌套事务。如果试图在子事务里使用 JDBC 连接,JBossJTA 将抛出相应的异常,该连接也不会允许任何操作。然而,如果你希望使用嵌套的事务,你可以设置 <property>com."
+"arjuna.ats.jta.supportSubtransactions</property> 为 YES。"
#. Tag: title
#: JDBC_and_Transactions.xml:63
#, no-c-format
msgid "Transactional drivers"
-msgstr ""
+msgstr "事务性驱动"
#. Tag: para
#: JDBC_and_Transactions.xml:64
#, no-c-format
+#, fuzzy
msgid ""
"The JBossJTA approach to incorporating JDBC connections within transactions "
"is to provide transactional JDBC drivers through which all interactions "
@@ -149,12 +152,15 @@
"code>, which implements the <interfacename>java.sql.Driver</interfacename> "
"interface."
msgstr ""
+""
+"这些驱动拦截所有的调用,确保它们向合适的事务注册并由之驱动。明显地,如果数据库不是事务性的,那么 ACID 属性也不能被保证。这个驱动是 <code>com.arjuna.ats.jdbc.TransactionalDriver</"
+"code>,它实现了 <interfacename>java.sql.Driver</interfacename> 接口。"
#. Tag: title
#: JDBC_and_Transactions.xml:68
#, no-c-format
msgid "Loading drivers"
-msgstr ""
+msgstr "加载驱动"
#. Tag: para
#: JDBC_and_Transactions.xml:69
@@ -297,13 +303,13 @@
"driver, application code can remain relatively the same to that when not "
"using transactions. Typically, the application programmer need only start "
"and terminate transactions."
-msgstr ""
+msgstr "因为只需提供新的 JDBC 驱动,JBossJTA 里的 JDBC 连接性就可以工作,程序代码可以和不使用事务的代码保持基本相同。通常,程序员只需要启动和终止事务。"
#. Tag: title
#: JDBC_and_Transactions.xml:103
#, no-c-format
msgid "JDBC 2.0"
-msgstr ""
+msgstr "JDBC 2.0"
#. Tag: para
#: JDBC_and_Transactions.xml:104
@@ -314,6 +320,8 @@
"all located in the <classname>com.arjuna.ats.jdbc.TransactionalDriver</"
"classname> class):"
msgstr ""
+"在描述对 JDBC 2.0 的支持之前,需要提及的是,你可以设置下列的属性并传递给 JBossJTA 驱动(它们位于 <classname>com.arjuna.ats.jdbc.TransactionalDriver</"
+"classname> 类里):"
#. Tag: para
#: JDBC_and_Transactions.xml:110
@@ -321,7 +329,7 @@
msgid ""
"<property>userName</property>: the user name to use when attempting to "
"connect to the database."
-msgstr ""
+msgstr "<property>userName</property>:连接数据库所用的用户名。"
#. Tag: para
#: JDBC_and_Transactions.xml:115
@@ -329,7 +337,7 @@
msgid ""
"<property>password</property>: the password to use when attempting to "
"connect to the database."
-msgstr ""
+msgstr "<property>password</property>:连接数据库时所用的密码。"
#. Tag: para
#: JDBC_and_Transactions.xml:120
@@ -338,7 +346,7 @@
"<property>createDb</property>: if set to true, the driver will attempt to "
"create the database when it connects. This may not be supported by all JDBC "
"2.0 implementations."
-msgstr ""
+msgstr "<property>createDb</property>:如果为 true,驱动在连接时将试图创建数据库。不是所有的 JDBC 2.0 实现都支持这个属性。"
#. Tag: para
#: JDBC_and_Transactions.xml:125
@@ -346,13 +354,13 @@
msgid ""
"<property>dynamicClass</property>: this specifies a class to instantiate to "
"connect to the database, rather than using JNDI."
-msgstr ""
+msgstr "<property>dynamicClass</property>:指定连接数据库时实例化类,而不是使用 JNDI。"
#. Tag: title
#: JDBC_and_Transactions.xml:131
#, no-c-format
msgid "XADataSources"
-msgstr ""
+msgstr "XADataSources"
#. Tag: para
#: JDBC_and_Transactions.xml:132
@@ -367,7 +375,7 @@
"<code>XAResources</code> which the transaction service will use when the "
"transaction terminates in order to drive the database to either commit or "
"rollback the changes made via the JDBC connection."
-msgstr ""
+msgstr "JDBC 2.0 连接根据合适的数据源创建。必须参与分布式事务的连接根据 <code>XADataSources</code> 创建。因此,当使用 JDBC 2.0 驱动时,每当创建一个数据库连接 JBossJTA 都将使用合适的数据源。它将获得 <code>XAResources</code> 并通过 JTA 接口向事务注册。事务终止时,事务服务将使用这些 <code>XAResources</code> 来驱动数据库对通过 JDBC 连接进行的修改执行提交或回滚。"
#. Tag: para
#: JDBC_and_Transactions.xml:136
@@ -377,13 +385,13 @@
"<code>XADataSources</code>. These will be explained in the following "
"sections. Note, for simplicity we shall assume that the JDBC 2.0 driver is "
"instantiated directly by the application."
-msgstr ""
+msgstr "JBossJTA 的 JDBC 2.0 支持可以两种方式获取 <code>XADataSources</code>。我们将在后续章节里进行解释。请注意,为了简单起见,我们假设 JDBC 2.0 驱动是应用程序直接实例化的。"
#. Tag: title
#: JDBC_and_Transactions.xml:140
#, no-c-format
msgid "Java Naming and Directory Interface (JNDI)"
-msgstr ""
+msgstr "Java 名称和目录接口(Java Naming and Directory Interface,JNDI)"
#. Tag: para
#: JDBC_and_Transactions.xml:141
@@ -434,7 +442,7 @@
msgid ""
"Where the <property>Context.INITIAL_CONTEXT_FACTORY</property> property is "
"the JNDI way of specifying the type of JNDI implementation to use."
-msgstr ""
+msgstr "这里的 <property>Context.INITIAL_CONTEXT_FACTORY</property> 属性以 JNDI 凡是指定使用的 JNDI 实现的类型。"
#. Tag: para
#: JDBC_and_Transactions.xml:152
@@ -442,7 +450,7 @@
msgid ""
"Then the application must pass an appropriate connection URL to the JDBC 2.0 "
"driver:"
-msgstr ""
+msgstr "然后应用程序必须传递合适的连接 URL 给 JDBC 2.0 驱动:"
#. Tag: screen
#: JDBC_and_Transactions.xml:155
@@ -457,6 +465,14 @@
"Connection connection = arjunaJDBC2Driver.connect(\"jdbc:arjuna:jdbc/foo\", "
"dbProps);"
msgstr ""
+"Properties dbProps = new Properties();\n"
+" \n"
+"dbProps.setProperty(TransactionalDriver.userName, \"user\");\n"
+"dbProps.setProperty(TransactionalDriver.password, \"password\");\n"
+" \n"
+"TransactionalDriver arjunaJDBC2Driver = new TransactionalDriver();\n"
+"Connection connection = arjunaJDBC2Driver.connect(\"jdbc:arjuna:jdbc/foo\", "
+"dbProps);"
#. Tag: para
#: JDBC_and_Transactions.xml:156
@@ -465,13 +481,13 @@
"The JNDI URL must be pre-pended with jdbc:arjuna: in order for the "
"<code>ArjunaJDBC2Driver</code> to recognise that the DataSource must "
"participate within transactions and be driven accordingly."
-msgstr ""
+msgstr "JNDI URL 必须以 jdbc:arjuna: 开头,这样 <code>ArjunaJDBC2Driver</code> 才能够知道这个数据源必须参与事务并相应地被驱动。"
#. Tag: title
#: JDBC_and_Transactions.xml:160
#, no-c-format
msgid "Dynamic class instantiation"
-msgstr ""
+msgstr "动态的类实例化"
#. Tag: para
#: JDBC_and_Transactions.xml:161
@@ -496,55 +512,55 @@
#: JDBC_and_Transactions.xml:166
#, no-c-format
msgid "Dynamic Class property values for specific databases"
-msgstr ""
+msgstr "专有数据库的动态类属性值"
#. Tag: entry
#: JDBC_and_Transactions.xml:170
#, no-c-format
msgid "Database Type"
-msgstr ""
+msgstr "数据库类型"
#. Tag: entry
#: JDBC_and_Transactions.xml:173
#, no-c-format
msgid "Property Name"
-msgstr ""
+msgstr "属性名"
#. Tag: entry
#: JDBC_and_Transactions.xml:180
#, no-c-format
msgid "Cloudscape 3.6"
-msgstr ""
+msgstr "Cloudscape 3.6"
#. Tag: entry
#: JDBC_and_Transactions.xml:183
#, no-c-format
msgid "com.arjuna.ats.internal.jdbc.drivers.cloudscape_3_6"
-msgstr ""
+msgstr "com.arjuna.ats.internal.jdbc.drivers.cloudscape_3_6"
#. Tag: entry
#: JDBC_and_Transactions.xml:188
#, no-c-format
msgid "Sequelink 5.1"
-msgstr ""
+msgstr "Sequelink 5.1"
#. Tag: entry
#: JDBC_and_Transactions.xml:191
#, no-c-format
msgid "com.arjuna.ats.internal.jdbc.drivers.sequelink_5_1"
-msgstr ""
+msgstr "com.arjuna.ats.internal.jdbc.drivers.sequelink_5_1"
#. Tag: entry
#: JDBC_and_Transactions.xml:196
#, no-c-format
msgid "Oracle 8.1.6"
-msgstr ""
+msgstr "Oracle 8.1.6"
#. Tag: entry
#: JDBC_and_Transactions.xml:199
#, no-c-format
msgid "com.arjuna.ats.internal.jdbc.drivers.oracle_8_1_6"
-msgstr ""
+msgstr "com.arjuna.ats.internal.jdbc.drivers.oracle_8_1_6"
#. Tag: para
#: JDBC_and_Transactions.xml:207
@@ -553,7 +569,7 @@
"As mentioned earlier, JBossTS no longer supports Cloudscape or Sequelink as "
"part of the qualified drivers. Furthermore, we recommend using JNDI to "
"obtain JDBC classes rather than the direct method described here."
-msgstr ""
+msgstr "如果前面所提及的,JBossTS 不再把 Cloudscape 和 Sequelink 作为认证的驱动来支持。而且,我们推荐使用 JNDI 来获取 JDBC 类而不是采用这里描述的直接方法。"
#. Tag: para
#: JDBC_and_Transactions.xml:211
@@ -562,7 +578,7 @@
"The application code must specify which dynamic class the "
"<code>TransactionalDriver</code> should instantiate when setting up the "
"connection:"
-msgstr ""
+msgstr "应用程序代码必须指定在建立连接时 <code>TransactionalDriver</code> 应该实例化哪个动态类:"
#. Tag: screen
#: JDBC_and_Transactions.xml:214
@@ -579,12 +595,22 @@
"Connection connection = arjunaJDBC2Driver.connect(\"jdbc:arjuna:sequelink://"
"host:port;databaseName=foo\",dbProperties);"
msgstr ""
+"Properties dbProps = new Properties();\n"
+" \n"
+"dbProps.setProperty(TransactionalDriver.userName, \"user\");\n"
+"dbProps.setProperty(TransactionalDriver.password, \"password\");\n"
+"dbProps.setProperty(TransactionalDriver.dynamicClass,\n"
+"\"com.arjuna.ats.internal.jdbc.drivers.sequelink_5_0\");\n"
+" \n"
+"TransactionalDriver arjunaJDBC2Driver = new TransactionalDriver();\n"
+"Connection connection = arjunaJDBC2Driver.connect(\"jdbc:arjuna:sequelink://"
+"host:port;databaseName=foo\",dbProperties);"
#. Tag: title
#: JDBC_and_Transactions.xml:216
#, no-c-format
msgid "Using the connection"
-msgstr ""
+msgstr "使用连接"
#. Tag: para
#: JDBC_and_Transactions.xml:217
@@ -596,13 +622,13 @@
"necessary to use the transactional connection within transactions. If a "
"transaction is not present when the connection is used, then operations will "
"be performed directly on the database."
-msgstr ""
+msgstr "一旦建立了连接(例如,使用 <methodname>java.sql.DriverManager.getConnection</methodname> 方法),JBossJTA 将监控该连接上的所有操作。请注意,在事务里使用事务性连接并非必需的。如果使用连接时,而事务并未启动,相关操作将直接在数据库上进行。"
#. Tag: para
#: JDBC_and_Transactions.xml:222
#, no-c-format
msgid "JDBC does not support subtransactions."
-msgstr ""
+msgstr "JDBC 不支持子事务。"
#. Tag: para
#: JDBC_and_Transactions.xml:226
@@ -610,7 +636,7 @@
msgid ""
"Transaction timeouts can be used to automatically terminate transactions "
"should the connection not be terminated within an appropriate period."
-msgstr ""
+msgstr "如果连接在某段时间内没有终止,系统将根据事务超时时间自动终止这个事务。"
#. Tag: para
#: JDBC_and_Transactions.xml:229
@@ -636,7 +662,7 @@
"this resource will be responsible for either committing or rolling back any "
"changes made to the underlying database via appropriate calls on the JDBC "
"driver."
-msgstr ""
+msgstr "JBossJTA 将通过合适的资源自动向事务注册 JDBC 驱动连接。当事务终止时,这个资源将通过合适的 JDBC 驱动调用负责提交或回滚任何对底层数据库的修改。"
#. Tag: para
#: JDBC_and_Transactions.xml:235
@@ -644,7 +670,7 @@
msgid ""
"Once created, the driver and any connection can be used in the same way as "
"any other JDBC driver or connection."
-msgstr ""
+msgstr "一旦被创建,这个驱动和任何连接可以和其他任何 JDBC 驱动或连接一样地使用。"
#. Tag: screen
#: JDBC_and_Transactions.xml:238
@@ -666,12 +692,27 @@
" \n"
"ResultSet res1 = stmt.executeQuery(\"SELECT * FROM test_table\");"
msgstr ""
+"Statement stmt = conn.createStatement();\n"
+" \n"
+"try\n"
+"{\n"
+" stmt.executeUpdate(\"CREATE TABLE test_table (a INTEGER,b INTEGER)"
+"\");\n"
+"}\n"
+"catch (SQLException e)\n"
+"{\n"
+" // table already exists\n"
+"}\n"
+" \n"
+"stmt.executeUpdate(\"INSERT INTO test_table (a, b) VALUES (1,2)\");\n"
+" \n"
+"ResultSet res1 = stmt.executeQuery(\"SELECT * FROM test_table\");"
#. Tag: title
#: JDBC_and_Transactions.xml:240
#, no-c-format
msgid "Connection pooling"
-msgstr ""
+msgstr "连接池"
#. Tag: para
#: JDBC_and_Transactions.xml:241
@@ -684,13 +725,13 @@
"connection are allowed, but the connection will only actually be closed when "
"all users (including transactions) have either finished with the connection, "
"or issued close calls."
-msgstr ""
+msgstr "对于每个用户名和密码,只要连接仍在使用,JBossJTA 将维护每个连接的单一实例。随后对相同连接的请求将获得原始连接的引用,而不是创建一个新的实例。关闭这个连接是允许的,但连接只有在所有的用户(包括事务)已经完成了对它的使用或执行 close 调用后才真正被关闭。"
#. Tag: title
#: JDBC_and_Transactions.xml:246
#, no-c-format
msgid "Reusing connections"
-msgstr ""
+msgstr "连接重用"
#. Tag: para
#: JDBC_and_Transactions.xml:247
@@ -704,19 +745,19 @@
"However, if an existing connection is available and is currently unused, it "
"is possible to make JBossJTA reuse this connection. In order to do this, the "
"reuseconnection=true option must be specified on the JDBC URL. For example:"
-msgstr ""
+msgstr "在给定的事务结束后,某些 JDBC 驱动允许将连接重用于其他不同的事务。可惜的是,这并非是共有的功能,有些驱动要求对每个新事务都使用新的连接。在缺省情况下,JBossJTA 事务性驱动将为每个新事务获取一个新的连接。然而,如果存在空闲的可用现有连接,JBossJTA 就有可能重用这个连接。为了实现这一点,在 JDBC URL 上必须指定 reuseconnection=true 选项。例如:"
#. Tag: screen
#: JDBC_and_Transactions.xml:251
#, no-c-format
msgid "jdbc:arjuna:sequelink://host:port;databaseName=foo;reuseconnection=true"
-msgstr ""
+msgstr "jdbc:arjuna:sequelink://host:port;databaseName=foo;reuseconnection=true"
#. Tag: title
#: JDBC_and_Transactions.xml:253
#, no-c-format
msgid "Terminating the transaction"
-msgstr ""
+msgstr "终止事务"
#. Tag: para
#: JDBC_and_Transactions.xml:254
@@ -727,13 +768,13 @@
"that has a JDBC connection registered with it, JBossJTA will drive the "
"database (via the JDBC driver) to either commit or roll back any changes "
"made to it. This happens transparently to the application."
-msgstr ""
+msgstr "每当有 JDBC 连接注册的事务终止时(显性地通过程序或关联的事务过期时),JBossJTA 将驱动数据库(通过这个 JDBC 驱动)来提交或回滚任何修改。这对于应用程序来说是透明的。"
#. Tag: title
#: JDBC_and_Transactions.xml:259
#, no-c-format
msgid "AutoCommit"
-msgstr ""
+msgstr "AutoCommit"
#. Tag: para
#: JDBC_and_Transactions.xml:260
@@ -746,13 +787,13 @@
"<code>AutoCommit</code> on JDBC 1.0 connections before they can be used. If "
"auto commit is subsequently set to true by the application, JBossJTA will "
"raise the <code>java.sql.SQLException</code>."
-msgstr ""
+msgstr "对于 JDBC 1.0 来说,如果 <code>java.sql.Connection</code> 的 <code>AutoCommit</code> 设置为 true,那么每个 SQL 语句的执行都是单独的顶层事务,你不可能把多个语句分组来并在单一的 OTS 事务里进行管理。因此,JBossJTA 将禁用 JDBC 1.0 连接的 <code>AutoCommit</code>。之后如果在程序里把它设置为 true,JBossJTA 将抛出 <code>java.sql.SQLException</code>。"
#. Tag: title
#: JDBC_and_Transactions.xml:265
#, no-c-format
msgid "Setting isolation levels"
-msgstr ""
+msgstr "设置隔离级别"
#. Tag: para
#: JDBC_and_Transactions.xml:266
@@ -767,10 +808,12 @@
"<code>TRANSACTION_READ_COMMITTED</code>, or "
"<code>TRANSACTION_REPEATABLE_READ</code>."
msgstr ""
+"当使用 JBossJTA JDBC 驱动时,你需要设置 XA 连接的底层事务隔离级别。在缺省情况下,它的值为 <code>TRANSACTION_SERIALIZABLE</code>,但你可能希望设置其为更合适的值。为了实现这一点,你可以以字符串的形式把 <property>com.arjuna.ats.jdbc.isolationLevel</property> 设置为想要的隔离级别,例如,<code>TRANSACTION_READ_COMMITTED</code> 或 "
+"<code>TRANSACTION_REPEATABLE_READ</code>。"
#. Tag: para
#: JDBC_and_Transactions.xml:271
#, no-c-format
msgid "At present this property applies to all XA connections created in the JVM."
-msgstr ""
+msgstr "目前,这个属性适用于 JVM 里创建的所有 XA 连接。"
More information about the jboss-svn-commits
mailing list