About the Servlet with JavaBean Example
This example demonstrates an Enterprise JavaBean (EJBean), and provides an example of a simple interface for accessing the Tuxedo Server. You can find the source code for this example in the /samples/jolt/wls/ejb/bankapp
directory included in the Oracle Tuxedo distribution.
Running this example before attempting to create your own EJBeans will show you the different steps involved. The example is a stateful session EJBean called
TellerBean
that contacts a Tuxedo Server using Jolt for WebLogic, and conducts transactions as follows:
- Contacts and calls a Tuxedo Server, and retrieves the returned results
- Uses a session EJBean
- Uses stateful persistence
- Uses application-defined exceptions and utilities
- Uses a client browser application
- Contacts the teller home ("TellerHome") through JNDI to find the EJBean.
- Creates a teller ("Terry").
- The application then performs a series of transactions for the Teller that has just been created:
- Gets the current balance for account 10000.
- Performs Transaction 1: Deposits $100 into the account, and displays the balance.
- Performs Transaction 2: Deposits $200 (more than the transaction limit of $300).
Note:
In Transaction 1, a single call is made, and is automatically committed. In Transaction 2, abegin()
andcommit()
bracket two separate requests (a deposit and a withdrawal). - Attempts to withdraw $100 more than the balance of the account.
- Catches an ApplicationException, retrieves the status messages embedded in the exception, and rolls back Transaction 2.
- Gets the final balance for the account.
- Removes the teller.
Parent topic: Servlet with Enterprise JavaBean Example