1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
5 *
6 * The contents of this file are subject to the terms of either the GNU
7 * General Public License Version 2 only ("GPL") or the Common Development
8 * and Distribution License("CDDL") (collectively, the "License"). You
9 * may not use this file except in compliance with the License. You can obtain
10 * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
11 * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
12 * language governing permissions and limitations under the License.
13 *
14 * When distributing the software, include this License Header Notice in each
15 * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
16 * Sun designates this particular file as subject to the "Classpath" exception
17 * as provided by Sun in the GPL Version 2 section of the License file that
18 * accompanied this code. If applicable, add the following below the License
19 * Header, with the fields enclosed by brackets [] replaced by your own
20 * identifying information: "Portions Copyrighted [year]
21 * [name of copyright owner]"
22 *
23 * Contributor(s):
24 *
25 * If you wish your version of this file to be governed by only the CDDL or
26 * only the GPL Version 2, indicate your decision by adding "[Contributor]
27 * elects to include this software in this distribution under the [CDDL or GPL
28 * Version 2] license." If you don't indicate a single choice of license, a
29 * recipient has the option to distribute your version of this file under
30 * either the CDDL, the GPL Version 2 or to extend the choice of license to
31 * its licensees as provided above. However, if you add GPL Version 2 code
32 * and therefore, elected the GPL Version 2 license, then the option applies
33 * only if the new code is made subject to such option by the copyright
34 * holder.
35 */
36
37 package javax.resource.spi;
38
39 import javax.resource.ResourceException;
40
41 /** LocalTransaction interface provides support for transactions that
42 * are managed internal to an EIS resource manager, and do not require
43 * an external transaction manager.
44 *
45 * <p>A resource adapter implements the javax.resource.spi.LocalTransaction
46 * interface to provide support for local transactions that are performed
47 * on the underlying resource manager.
48 *
49 * <p>If a resource adapter supports the LocalTransaction interface, then
50 * the application server can choose to perform local transaction
51 * optimization (uses local transaction instead of a JTA transaction for
52 * a single resource manager case).
53 *
54 * @version 0.5
55 * @author Rahul Sharma
56 * @see javax.resource.spi.ManagedConnection
57 **/
58
59
60
61 public interface LocalTransaction {
62 /** Begin a local transaction
63 *
64 * @throws ResourceException generic exception if operation fails
65 * @throws LocalTransactionException
66 * error condition related
67 * to local transaction management
68 * @throws ResourceAdapterInternalException
69 * error condition internal to resource
70 * adapter
71 * @throws EISSystemException EIS instance specific error condition
72 **/
73 public
74 void begin() throws ResourceException;
75
76 /** Commit a local transaction
77 *
78 * @throws ResourceException generic exception if operation fails
79 * @throws LocalTransactionException
80 * error condition related
81 * to local transaction management
82 * @throws ResourceAdapterInternalException
83 * error condition internal to resource
84 * adapter
85 * @throws EISSystemException EIS instance specific error condition
86 **/
87 public
88 void commit() throws ResourceException;
89
90 /** Rollback a local transaction
91 * @throws ResourceException generic exception if operation fails
92 * @throws LocalTransactionException
93 * error condition related
94 * to local transaction management
95 * @throws ResourceAdapterInternalException
96 * error condition internal to resource
97 * adapter
98 * @throws EISSystemException EIS instance specific error condition
99 **/
100 public
101 void rollback() throws ResourceException;
102
103 }