1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.resource.spi;
  6. import javax.resource.ResourceException;
  7. /** A LocalTransactionException represents various error conditions related
  8. * to the local transaction management contract. The JTA specification
  9. * specifies the javax.transaction.xa.XAException class for exceptions
  10. * related to XAResource based transaction management contract.
  11. *
  12. * <p>The LocalTransactionException is used for the local transaction
  13. * management contract to indicate the following common error conditions:
  14. * <UL>
  15. * <LI>invalid transaction context when a transaction operation is executed.
  16. * For example, calling LocalTransaction.commit method without an active
  17. * local transaction is an error condition
  18. * <LI>transaction is rolled back instead of getting committed in the
  19. * LocalTransaction.commit method.
  20. * <LI>attempt to start a local transaction from the same thread on a
  21. * ManagedConnection that is already associated with an active local
  22. * transaction
  23. * <LI>any resource adapter or resource manager specific error conditions
  24. * related to local transaction management. Examples are violation of
  25. * integrity of resources, deadlock detection, communication failure
  26. * during transaction completion, retry required or any internal error
  27. * in a resource manager.
  28. * </UL>
  29. * @version 0.7
  30. * @author Rahul Sharma
  31. */
  32. public class LocalTransactionException extends javax.resource.ResourceException {
  33. /**
  34. * Create a LocalTransactionException.
  35. *
  36. * @param reason a description of the exception
  37. * @param errorCode a string specifying the vendor specific
  38. * error code
  39. **/
  40. public
  41. LocalTransactionException(String reason, String errorCode) {
  42. super(reason, errorCode);
  43. }
  44. /**
  45. * Create a LocalTransactionException with reason.
  46. *
  47. * @param reason a description of the exception
  48. **/
  49. public
  50. LocalTransactionException(String reason) {
  51. super(reason);
  52. }
  53. }