1 PACKAGE dbms_app_cont AS
2
3 ------------
4 -- OVERVIEW
5 --
6 -- This package allows an application to determine the outcome of
7 -- a transaction.
8
9 ------------
10 -- SECURITY
11 --
12 -- The execute privilage of the package is granted to DBA role only.
13
14 ----------------
15 -- INSTALLATION
16 --
17 -- This package should be installed under SYS schema.
18 --
19 -- SQL> @dbmsappcont
20 --
21
22 ----------------------------
23 -- CONSTANTS
24 --
25 NOT_COMMITTED CONSTANT NUMBER(1) := 1;
26 COMMITTED CONSTANT NUMBER(1) := 2;
27
28
29 -------------------------
30 -- ERRORS AND EXCEPTIONS
31 --
32 -- When adding errors remember to add a corresponding exception below.
33
34 err_server_ahead CONSTANT NUMBER := -14950;
35 err_client_ahead CONSTANT NUMBER := -14951;
36 err_general_failure CONSTANT NUMBER := -14952;
37
38 exc_server_ahead EXCEPTION;
39 PRAGMA EXCEPTION_INIT(exc_server_ahead, -14950);
40 exc_client_ahead EXCEPTION;
41 PRAGMA EXCEPTION_INIT(exc_client_ahead, -14951);
42 exc_general_failure EXCEPTION;
43 PRAGMA EXCEPTION_INIT(exc_general_failure, -14952);
44
45
46 ----------------------------
47 -- PROCEDURES AND FUNCTIONS
48 --
49 PROCEDURE get_ltxid_outcome(client_ltxid IN RAW,
50 committed OUT BOOLEAN,
51 user_call_completed OUT BOOLEAN);
52 -- Forces the outcome of a transaction. If the transaction has not
53 -- been commited yet, a fake transaction is committed. Otherwise the
54 -- the state of the transaction is returned.
55 --
56 -- Input parameter(s):
57 -- client_ltxid
58 -- LTXID from the client driver.
59 --
60 -- Output parameter(s):
61 -- committed - Transaction has been committed
62 -- user_call_completed - User call that committed the transaction has
63 -- been completed.
64 --
65 -- Exceptions:
66 -- - SERVER_AHEAD, the server is ahead, so the transaction is an
67 -- old transaction and must have already been
68 -- committed.
69 -- - CLIENT_AHEAD, the client is ahead of the server. This can only
70 -- happen if the server has been flashbacked or the
71 -- ltxid is corrupted. In any way, the outcome
72 -- cannot be determined.
73 -- - ERROR, the outcome cannot be determined. During processing an
74 -- error happened.
75 -- error
76 -- Error code raised during the execution of force_outcome.
77 --
78 END dbms_app_cont;