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. /** LocalTransaction interface provides support for transactions that
  8. * are managed internal to an EIS resource manager, and do not require
  9. * an external transaction manager.
  10. *
  11. * <p>A resource adapter implements the javax.resource.spi.LocalTransaction
  12. * interface to provide support for local transactions that are performed
  13. * on the underlying resource manager.
  14. *
  15. * <p>If a resource adapter supports the LocalTransaction interface, then
  16. * the application server can choose to perform local transaction
  17. * optimization (uses local transaction instead of a JTA transaction for
  18. * a single resource manager case).
  19. *
  20. * @version 0.5
  21. * @author Rahul Sharma
  22. * @see javax.resource.spi.ManagedConnection
  23. **/
  24. public interface LocalTransaction {
  25. /** Begin a local transaction
  26. *
  27. * @throws ResourceException generic exception if operation fails
  28. * @throws LocalTransactionException
  29. * error condition related
  30. * to local transaction management
  31. * @throws ResourceAdapterInternalException
  32. * error condition internal to resource
  33. * adapter
  34. * @throws EISSystemException EIS instance specific error condition
  35. **/
  36. public
  37. void begin() throws ResourceException;
  38. /** Commit a local transaction
  39. *
  40. * @throws ResourceException generic exception if operation fails
  41. * @throws LocalTransactionException
  42. * error condition related
  43. * to local transaction management
  44. * @throws ResourceAdapterInternalException
  45. * error condition internal to resource
  46. * adapter
  47. * @throws EISSystemException EIS instance specific error condition
  48. **/
  49. public
  50. void commit() throws ResourceException;
  51. /** Rollback a local transaction
  52. * @throws ResourceException generic exception if operation fails
  53. * @throws LocalTransactionException
  54. * error condition related
  55. * to local transaction management
  56. * @throws ResourceAdapterInternalException
  57. * error condition internal to resource
  58. * adapter
  59. * @throws EISSystemException EIS instance specific error condition
  60. **/
  61. public
  62. void rollback() throws ResourceException;
  63. }