分享
 
 
 

javax.ejb.SessionSynchronization翻译

王朝java/jsp·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

[/url] [url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

javax.ejb

Interface SessionSynchronizationpublic interface SessionSynchronization

The SessionSynchronization interface allows a session Bean instance to be notified by its container of transaction boundaries. SessionSynchronization接口允许会话Bean实例接收容器关于事务边界的通知。

An session Bean class is not required to implement this interface. A session Bean class should implement this interface only if it wishes to synchronize its state with the transactions. 会话Bean类不要求实现该接口。只有当会话Bean类希望实现与事务同步状态时才应该实现该接口。

Method Summary

void

afterBegin()

The afterBegin method notifies a session Bean instance that a new transaction has started, and that the subsequent business methods on the instance will be invoked in the context of the transaction. afterBegin方法通知会话Bean实例新事务开始,随后该实例的业务方法将在事务上下文中调用。

void

afterCompletion(boolean committed)

The afterCompletion method notifies a session Bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back. afterCompletion方法通知会话Bean实例事务提交协议已经完成,告知实例事务 是要提交还是回滚。

void

beforeCompletion()

The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed. beforeCompletion方法通知会话Bean实例事务将被提交。

Method Detail

afterBeginpublic void afterBegin()

throws EJBException,

RemoteException

The afterBegin method notifies a session Bean instance that a new transaction has started, and that the subsequent business methods on the instance will be invoked in the context of the transaction. afterBegin方法通知会话Bean实例新事务开始,随后该实例的业务方法将在事务上下文中调用。 The instance can use this method, for example, to read data from a database and cache the data in the instance fields. 实例可以使用该方法,比如从数据库中读取数据,在实例字段中缓存数据。

This method executes in the proper transaction context. 该方法在原事务上下文中执行。

Throws: EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。 RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 and higher specifications should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB 2.0 and higher specifications must not throw the java.rmi.RemoteException. 方法签名中定义该异常是为了对符合EJB 1.0规范的企业bean提供向下兼容。 符合EJB 1.1规范的企业bean应该抛出javax.ejb.EJBException来代替该异常。 符合EJB 2.0或更高版本规范的企业bean也应该抛出javax.ejb.EJBException 来代替该异常。beforeCompletionpublic void beforeCompletion()

throws EJBException,

RemoteException

The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed. The instance can use this method, for example, to write any cached data to a database. beforeCompletion方法通知会话Bean实例事务将被提交。实例可以使用该方法,比如向数据库写缓存数据。 This method executes in the proper transaction context. 该方法在原事务上下文中执行。

Note: The instance may still cause the container to rollback the transaction by invoking the setRollbackOnly() method on the instance context, or by throwing an exception. 注意:实例可是有可能在实例上下文中调用setRollbackOnly()方法或者抛出异常造成容器回滚事务。

Throws: EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。 RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 and higher specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB 2.0 and higher specifications must not throw the java.rmi.RemoteException. 方法签名中定义该异常是为了对符合EJB 1.0规范的企业bean提供向下兼容。 符合EJB 1.1规范的企业bean应该抛出javax.ejb.EJBException来代替该异常。 符合EJB 2.0或更高版本规范的企业bean也应该抛出javax.ejb.EJBException 来代替该异常。afterCompletionpublic void afterCompletion(boolean committed)

throws EJBException,

RemoteException

The afterCompletion method notifies a session Bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back. afterCompletion方法通知会话Bean实例事务提交协议已经完成,告知实例事务 是要提交还是回滚。 This method executes with no transaction context. 该方法不在事务上下文中执行。

Parameters: committed - True if the transaction has been committed, false if is has been rolled back. 如果事务已提交,返回true,如果已回滚,返回false。 Throws: EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。 RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 and higher specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB 2.0 and higher specifications must not throw the java.rmi.RemoteException. 方法签名中定义该异常是为了对符合EJB 1.0规范的企业bean提供向下兼容。 符合EJB 1.1规范的企业bean应该抛出javax.ejb.EJBException来代替该异常。 符合EJB 2.0或更高版本规范的企业bean也应该抛出javax.ejb.EJBException 来代替该异常。[/url][url=file:///F:/资料/文字资料/j2ee-1.4_doc/apidocs/overview-summary.html]Overview

Package

Class

Tree

Deprecated

Index

Help

JavaTM 2 Platform

Ent. Ed. v1.4

PREV CLASS NEXT CLASS

FRAMES NO FRAMES All Classes

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature Copyright 2003 Sun Microsystems, Inc. All rights reserved.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有