DBA Data[Home] [Help]

PACKAGE: SYS.DBMS_XA

Source


1 PACKAGE dbms_xa AUTHID CURRENT_USER as
2 
3 
4 /*
5 ********************************************************************************
6 *   The following defines the XA APIs (see X/Open CAE Standard) in PL/SQL      *
7 ********************************************************************************
8 */
9 FUNCTION XA_START(xid IN DBMS_XA_XID, flag IN PLS_INTEGER)  RETURN PLS_INTEGER;
10 FUNCTION XA_END(xid IN DBMS_XA_XID, flag IN PLS_INTEGER)  RETURN PLS_INTEGER;
11 FUNCTION XA_PREPARE(xid IN DBMS_XA_XID)  RETURN PLS_INTEGER;
12 FUNCTION XA_COMMIT(xid IN DBMS_XA_XID, onePhase IN BOOLEAN)  RETURN PLS_INTEGER;
13 FUNCTION XA_ROLLBACK(xid IN DBMS_XA_XID)  RETURN PLS_INTEGER;
14 FUNCTION XA_FORGET(xid IN DBMS_XA_XID)  RETURN PLS_INTEGER;
15 FUNCTION XA_RECOVER RETURN DBMS_XA_XID_ARRAY;
16 FUNCTION XA_SETTIMEOUT(seconds IN PLS_INTEGER) RETURN PLS_INTEGER;
17 FUNCTION XA_GETLASTOER RETURN PLS_INTEGER;
18 
19 
20 /*
21 ********************************************************************************
22 *   The following procedure is used for recovery sync in RAC                   *
23 ********************************************************************************
24 */
25 PROCEDURE dist_txn_sync;
26 
27 
28 /*
29 ********************************************************************************
30 *   The following constants are defined for use in the flag field for          *
31 *   XA_START() and XA_END() functions:                                         *
32 ********************************************************************************
33 */
34 
35 /* use TMNOFLAGS to indicate no flag value is selected */
36 TMNOFLAGS CONSTANT PLS_INTEGER := 00000000;
37 
38 /* dissociate caller from transaction branch */
39 TMSUCCESS  CONSTANT PLS_INTEGER := utl_raw.cast_to_binary_integer('04000000');
40 
41 /* caller is joining existing transaction branch */
42 TMJOIN CONSTANT PLS_INTEGER := utl_raw.cast_to_binary_integer('00200000');
43 
44 /* caller is suspending, not ending, association */
45 TMSUSPEND  CONSTANT PLS_INTEGER := utl_raw.cast_to_binary_integer('02000000');
46 
47 /* caller is resuming association with suspended transaction branch */
48 TMRESUME  CONSTANT PLS_INTEGER := utl_raw.cast_to_binary_integer('08000000');
49 
50 /*
51 ********************************************************************************
52 *   The following constants are defined for possible return value of           *
53 *   DBMS_XA functions:                                                         *
54 ********************************************************************************
55 */
56 
57 /* The inclusive lower bound of the rollback codes */
58 XA_RBBASE   CONSTANT PLS_INTEGER := 100;
59 
60 /* The rollback was caused by an unspecified reason */
61 XA_RBROLLBACK CONSTANT PLS_INTEGER := XA_RBBASE;
62 
63 /* The rollback was caused by a communication failure */
64 XA_RBCOMMFAIL  CONSTANT PLS_INTEGER :=  XA_RBBASE+1;
65 
66 /* A deadlock was detected*/
67 XA_RBDEADLOCK CONSTANT PLS_INTEGER := XA_RBBASE+2;
68 
69 /* A condition that violates the integrity of the resources was detected */
70 XA_RBINTEGRITY  CONSTANT PLS_INTEGER := XA_RBBASE+3;
71 
72 /* The resource manager rolled back the transaction for a reason not on
73    this list */
74 XA_RBOTHER  CONSTANT PLS_INTEGER := XA_RBBASE+4;
75 
76 /* A protocol error occurred in the resource manager */
77 XA_RBPROTO CONSTANT PLS_INTEGER := XA_RBBASE+5;
78 
79 /* A transaction branch took long */
80 XA_RBTIMEOUT  CONSTANT PLS_INTEGER := XA_RBBASE+6;
81 
82 /* May retry the transaction branch */
83 XA_RBTRANSIENT CONSTANT PLS_INTEGER :=  XA_RBBASE+7;
84 
85 /* The inclusive upper bound of the rollback codes */
86 XA_RBEND  CONSTANT PLS_INTEGER := XA_RBTRANSIENT;
87 
88 /* resumption must occur where suspension occurred */
89 XA_NOMIGRATE   CONSTANT PLS_INTEGER :=  9;
90 
91 /* the transaction branch may have been heuristically completed */
92 XA_HEURHAZ CONSTANT PLS_INTEGER := 8;
93 
94 /* the transaction branch has been heuristically committed */
95 XA_HEURCOM CONSTANT PLS_INTEGER := 7;
96 
97 /* the transaction branch has been heuristically rolled back */
98 XA_HEURRB  CONSTANT PLS_INTEGER :=  6;
99 
100 /* some of the transaction branches has been heuristically committed,
101    others have been rolled back */
102 XA_HEURMIX  CONSTANT PLS_INTEGER :=  5;
103 
104 /* routine returned with no effect and may be re-issued */
105 XA_RETRY  CONSTANT PLS_INTEGER := 4;
106 
107 /* the transaction was read-only and has been committed */
108 XA_RDONLY  CONSTANT PLS_INTEGER := 3;
109 
110 /* normal execution */
111 XA_OK   CONSTANT PLS_INTEGER := 0;
112 
113 /* asynchronous operation already outstanding */
114 XAER_ASYNC  CONSTANT PLS_INTEGER :=  -2;
115 
116 /* a resource manager error occurred in the transaction branch */
117 XAER_RMERR CONSTANT PLS_INTEGER :=  -3;
118 
119 /* the XID is not valid */
120 XAER_NOTA CONSTANT PLS_INTEGER := -4;
121 
122 /* invalid arguments were given */
123 XAER_INVAL CONSTANT PLS_INTEGER := -5;
124 
125 /* routine invoked in an improper context */
126 XAER_PROTO CONSTANT PLS_INTEGER := -6;
127 
128 /* resource manager unavailable */
129 XAER_RMFAIL CONSTANT PLS_INTEGER :=  -7;
130 
131 /* the XID already exists */
132 XAER_DUPID CONSTANT PLS_INTEGER :=  -8;
133 
134 /* resource manager doing work outside global transaction*/
135 XAER_OUTSIDE CONSTANT PLS_INTEGER :=  -9;
136 
137 END dbms_xa;