WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

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.


Field Summary
(package private)  Account account1
           
(package private)  java.lang.String account1Id
           
(package private)  AccountPK account1PK
           
(package private)  AccountResult account1Result
           
(package private)  Account account2
           
(package private)  java.lang.String account2Id
           
(package private)  AccountPK account2PK
           
(package private)  AccountResult account2Result
           
(package private)  double amount
           
(package private)  java.lang.String transactionId
           
(package private)  javax.transaction.UserTransaction tx
           
 
Constructor Summary
(package private) TellerBean.Transaction()
           
 
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
 

Field Detail

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
Constructor Detail

TellerBean.Transaction

TellerBean.Transaction()
Method Detail

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 transaction
javax.ejb.FinderException - if there is an error in finding the EJBean
java.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 balance
java.rmi.RemoteException - if there is a communications or systems failure

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.