#
# Copyright (c) 1995, 2018 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception, which is available at
# https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#

README file for TxRN_Exceptions
-------------------------------

Handling of exceptions thrown by a business method
of an EJB with Container Managed transactions.

Specification assertion under test: 
        18.3    Container Provider responsibilities.
        18.3.1  Exceptions from EJB's business methods

The assertion:
If the Bean method runs in the context of a transaction that the
Container started immediately before dispatching the business
method then, for:

Application Exceptions:
        Container's action:
        If the instance called setRollbackOnly(), then rollback
        the transaction, and re-throw AppException.
        Otherwise, attempt to commit the transaction, and then 
        re-throw the AppException.
        Client's view:
        Recieves AppException.
        If the client executes in a transaction, the client's
        transaction is not marked for rollback, and the client can
        continue its work.

All other exceptions:
        Container's action:
        o       Log the exception or error.
        o       Rollback the container-started transaction.
        o       Discard instance.
        o       Throw RemoteException.
        Client's view:
        Receives a RemoteException.
        If the client executes in a transaction, the client's
        transaction is not marked for rollback, and the client can continue
        its work.

Test Case(s):
Check that the Container and the Client do what is required of them in
the following conditions:
o       AppException from EJB.
o       AppException from EJB with a setRollbackOnly specified.
o       SystemException from EJB.
o       Vanilla RemoteExcetion from EJB.
o       EJBException from EJB.
o       Error from EJB.

The test itself is made up of:
1 Client
1 TestTean, this bean:
        o       drives the tests and is TX_BEAN_MANAGED 
        o       acts as a client to the JDBC transactional bean (TxBean).
1 TxBean, this bean:
        o       is the JDBC transactional bean and is called by TestBean.

