examples.cluster.ejb.teller
Class TellerBean.Transaction
java.lang.Object
|
+--examples.cluster.ejb.teller.TellerBean.Transaction
- Direct Known Subclasses:
- TellerBean.Balance, TellerBean.Deposit, TellerBean.Transfer, TellerBean.Withdrawal
- Enclosing class:
- TellerBean
- class TellerBean.Transaction
- extends java.lang.Object
Inner class that is used for transactions
with the entity beans.
Subclassed to perform specific transaction types.
Method Summary |
(package private) void |
invokeTransaction()
Basic transaction: finds an account bean
based on the primary key. |
(package private) TellerResult |
transaction()
Conducts a transaction, based on transaction type. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
account1
Account account1
account1Id
java.lang.String account1Id
account1PK
AccountPK account1PK
account1Result
AccountResult account1Result
account2
Account account2
account2Id
java.lang.String account2Id
account2PK
AccountPK account2PK
account2Result
AccountResult account2Result
amount
double amount
transactionId
java.lang.String transactionId
tx
javax.transaction.UserTransaction tx
TellerBean.Transaction
TellerBean.Transaction()
invokeTransaction
void invokeTransaction()
throws AccountException,
javax.ejb.FinderException,
java.rmi.RemoteException
- Basic transaction: finds an account bean
based on the primary key.
Overshadowed in subclassess
that perform specific types of transactions.
- Throws:
AccountException
- if there is
an error in performing the transactionjavax.ejb.FinderException
- if there is
an error in finding the EJBeanjava.rmi.RemoteException
- if there is
a communications or systems failure
transaction
TellerResult transaction()
throws TellerException,
java.rmi.RemoteException
- Conducts a transaction, based on transaction type.
Just prior to and just after committing the transaction,
the method prints a "failover test point" message in the
server output log and then sleeps for approximatly two seconds
to allow you to test failover before and after a transaction has
been committed.
- Returns:
- TellerResult result of inquiry
- Throws:
TellerException
- if there is an error while checking the balancejava.rmi.RemoteException
- if there is a communications or systems failure
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.