Listing 1 shows how we specify the transaction context for an atomic request.
清单1展示了我们如何指定原子请求的事务上下文。
Listing 2 shows how to start, execute, and commit a transaction.
清单2将显示如何启动、执行和提交事务。
Note: in Listing 14, the SALES_FACT table is populated in a single transaction, which will require a large amount of disk space for logging.
注意:在清单14中,sales_fact表是通过单独一个事务填充完成的,这需要占用大量的磁盘空间来记录日志。
Listing 7 begins by expecting that the search is for a specific transaction.
清单7首先期望搜索针对的是一个特定的交易。
Therefore, the code in Listing 13 is useless from a transaction standpoint; although it appears that it USES transactions to maintain atomicity and consistency, in fact it does not.
因此,清单13中的代码从事务角度来说毫无用处;尽管看上去它使用事务来维护原子性和一致性,但事实上并没有。
This approach, in combination with the aspect in Listing 2 and Listing 6, results in surrounding the methods' execution with transaction management logic.
将这种方法与清单2和清单6中的方面结合,就可以将事务管理逻辑用于方法的执行。
The code in Listing 2 is intended to pull from the list either all transactions if no filter is specified or a single transaction together with the related project information.
清单2中的代码旨在查询到列表中的所有交易(若没有指定过滤条件的话)或者单个交易以及相关的项目信息。
The coordinator collects all the votes and determines the transaction can be Committed (see Listing 11).
协调器收集所有投票,确定事务可以被提交(请参阅清单11 )。
The JDBC code in Listing 1 includes no transaction logic, yet it persists the trade order in the TRADE table in the database.
清单1中的JDBC代码没有包含任何事务逻辑,它只是在数据库中保存TRADE表中的交易订单。
Listing 15 shows the plan for the payment transaction.
清单15展示了支付事务的计划。
Unlike the example in Listing 1, with declarative transaction demarcation there is no transaction management code in the component methods.
与清单1中的示例不同,由于有宣告式事务划分,这段组件代码中没有事务管理代码。
Listing 10: Checking for the transaction log archive mode status?
清单10:查看事务日志归档模式状态。
Create the file system for the DB2 data and transaction logs at the primary site, and then change the owner to the DB2 instance owner, as shown in Listing 6.
在主站点创建DB 2数据以及事务日志的文件系统,并将所有者改为此DB 2实例的所有者,如清单6所示。
Each GET invocation returns a JSON-formatted data representation of the status of the transaction being queried, as shown in Listing 5.
每个GET调用返回一个json格式的字符串,这是查询的交易的状态数据,见清单5。
As you can see from Listing 4, if an exception is thrown in either of the update methods, it is the client layer method's responsibility to do the necessary transaction rollback.
从清单4中可以看到,如果任何一个更新方法抛出异常,则客户端层方法将负责执行必要的事务回滚。
Now retrieve the amount overdue from the account 12345, and rollback the transaction after doing so again, as shown in Listing 10.
现在从帐户12345检索过期时间量,然后再次回滚该事务,如清单10所示。
Listing 2 shows a simple transaction.
清单2显示了一个简单的事务。
In this case, because you want to perform a read-only lookup of the status of a single transaction, the GET method is an obvious fit using the URI pattern, as shown in Listing 4.
在这个示例中,因为希望对单一交易的状态执行只读查询,显然应该使用GET方法,使用的URI模式见清单4。
The corresponding error message is returned for the UPDATE statement in the victim transaction, as shown in Listing 19.
出错的事务的update语句返回相应错误信息,如清单19所示。
Listing 4 is a XML sample response for the transaction.
清单4是这个事务的XML响应示例。
Rather than brokering transactions, Alibaba charges suppliers for listing items and for extra promotion, leaving them to seal the transaction off the site.
但阿里巴巴并不是扮演经纪行的角色,该网站向供应商收取发布产品信息和额外推广的费用,让他们在网站之外达成交易。
Listing 1 from the EJB deployment descriptor provides an example of setting transaction attributes for the funds transfer entity EJB.
摘自ejb部署描述符的清单1提供了一个为资金转帐实体eJB设置事务属性的例子。
Listing 4: Restoring the salesdb database from a backup and placing the transaction log in different location.
清单4:从备份恢复salesdb数据库并将事务日志放在不同的位置。
So, you test the code in Listing 3 and discover that the persist method didn't work without a transaction.
您将测试清单3中的代码,发现persist方法在没有事务的情况下不能工作。
The Coordination Service returns a CoordinationContext that is used to uniquely identify the transaction (and includes the address of the Registration) as shown in Listing 2.
协调服务返回用于唯一地标识事务的CoordinationContext(还包含注册服务的地址),如清单2所示。
Now I'll fix the code in Listing 1 by applying the High Concurrency transaction strategy's read-first technique.
现在,我将修复清单1中的代码,方法是应用HighConcurrency事务策略的先读取技巧。
Notice in Listing 1 that the autoCommit value is set to true, indicating to the DBMS that the local transaction should be committed after each database statement.
注意,在清单1中,autocommit值设置为true,这将指示DBMS应该在各数据库语句之后提交本地事务。
After the application has a reference to the UserTransaction object it may start the transaction, as shown in Listing 5.
当应用程序找到了UserTransaction对象后,就可以开始事务了,如清单5所示。
Listing 3 shows how to demarcate a transaction using the JDBC API.
清单3显示了如何用JDBCAPI界定一个事务?
The transaction duration in the new code is only 300 ms, dramatically lower than the 6100 ms from Listing 1.
在新代码中,事务持续时间只有300ms,这显著低于清单1中的6100 ms。
应用推荐