企业级 Java 事务管理详解
1. 银行 EJB 与资金交换
在资金交换场景中,我们有相关的接口和方法来保障操作的安全进行。以下是银行 EJB 相关的接口定义:
IllegalArgumentException;
/**
* Obtains the current balance from the account with the specified ID
* @param accountId
* @return
* @throws IllegalArgumentException If the account ID is not valid
*/
BigDecimal getBalance(long accountId) throws IllegalArgumentException;
/**
* Transfers the specified amount from one account to another
* @param accountIdFrom The ID of the account from which we'll withdraw
* @param accountIdTo The ID of the account to which we'll deposit
* @param amount The amount to be transferred
* @throws IllegalArgumentException If the amount is not specified, the amount
is
* less than 0, or either account ID is inv
超级会员免费看
订阅专栏 解锁全文
1498

被折叠的 条评论
为什么被折叠?



