LocalTransaction (Java EE 5)

Java EE API


javax.resource.cci Interface LocalTransaction


public interface LocalTransaction


LocalTransaction 为资源管理器本地事务定义事务划分接口。注意,此接口用于应用程序级别的本地事务划分。容器使用系统协定级别 LocalTransaction 接口(在 javax.resource.spi 包中定义)进行本地事务管理。

本地事务在资源管理器内部管理。在协调此类事务时不涉及外部事务管理器。

CCI 实现可以(但不需要)实现 LocalTransaction 接口。如果 CCI 实现支持 LocalTransaction 接口,则方法 Connection.getLocalTransaction 应该返回一个 LocalTransaction 实例。然后组件可以使用返回的 LocalTransaction 在底层 EIS 实例上划分资源管理器本地事务(与 Connection 实例关联)。

英文文档:

The LocalTransaction defines a transaction demarcation interface for resource manager local transactions. Note that this interface is used for application level local transaction demarcation. The system contract level LocalTransaction interface (as defined in the javax.resource.spi package) is used by the container for local transaction management.

A local transaction is managed internal to a resource manager. There is no external transaction manager involved in the coordination of such transactions.

A CCI implementation can (but is not required to) implement the LocalTransaction interface. If the LocalTransaction interface is supported by a CCI implementation, then the method Connection.getLocalTransaction should return a LocalTransaction instance. A component can then use the returned LocalTransaction to demarcate a resource manager local transaction (associated with the Connection instance) on the underlying EIS instance.

Since:
0.8
Author:
Rahul Sharma
See Also:
Connection

Method Summary
 void
 void
 void
 

Method Detail

public void begin() throws ResourceException
在 EIS 实例上开始一个本地事务。
ThrowsResourceException: 无法开始本地事务。错误情况的示例有:
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 连接已参与本地或 JTA 事务
英文文档:

begin

void begin()
           throws ResourceException
Begins a local transaction on an EIS instance.

Throws:
ResourceException - Failed to begin a local transaction. Examples of error cases are:
  • Resource adapter internal or EIS-specific error
  • Connection is already participating in a local or JTA transaction

public void commit() throws ResourceException
提交当前的本地事务并释放由底层 EIS 实例包含的所有锁。
ThrowsResourceException: 无法提交本地事务。错误情况的示例有:
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 违反完整性约束、死锁检测、事务完成期间的通信故障、任何重试要求。
  • 连接参与到活动的 JTA 事务中
  • 无效的事务上下文;在不带活动事务上下文的情况下调用了提交操作
英文文档:

commit

void commit()
            throws ResourceException
Commits the current local transaction and release all locks held by the underlying EIS instance.

Throws:
ResourceException - Failed to commit a local transaction. Examples of error cases are:
  • Resource adapter internal or EIS-specific error
  • Violation of integrity constraints, deadlock detection, communication failure during transaction completion, or any retry requirement
  • Connection is participating in an active JTA transaction
  • Invalid transaction context; commit operation invoked without an active transaction context

public void rollback() throws ResourceException
回滚当前资源管理器本地事务。
ThrowsResourceException: 无法回滚本地事务。错误情况的示例有:
  • 资源适配器内部错误或者特定于 EIS 的错误
  • 连接参与到活动的 JTA 事务中
  • 无效的事务上下文;在不带活动事务上下文的情况下调用了回滚操作
英文文档:

rollback

void rollback()
              throws ResourceException
Rollbacks the current resource manager local transaction.

Throws:
ResourceException - Failed to rollback a local transaction. Examples of error cases are:
  • Resource adapter internal or EIS-specific error
  • Connection is participating in an active JTA transaction
  • Invalid transaction context; rollback operation invoked without an active transaction context


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!