1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdbc_TransactionIsolation_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdbc_TransactionIsolation_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
27cdf0e10cSrcweir
28cdf0e10cSrcweir
29cdf0e10cSrcweir/** distinguishes different possible transaction isolation levels.
30cdf0e10cSrcweir */
31cdf0e10cSrcweirpublished constants TransactionIsolation
32cdf0e10cSrcweir{
33cdf0e10cSrcweir
34cdf0e10cSrcweir	/** indicates that transactions are not supported.
35cdf0e10cSrcweir	 */
36cdf0e10cSrcweir	const long NONE					=  0;
37cdf0e10cSrcweir
38cdf0e10cSrcweir	/** Dirty reads, non-repeatable reads and phantom reads can occur.
39cdf0e10cSrcweir		     This level allows a row changed by one transaction to be read
40cdf0e10cSrcweir		     by another transaction before any changes in that row have been
41cdf0e10cSrcweir		     committed (a "dirty read").  If any of the changes are rolled back,
42cdf0e10cSrcweir		     the second transaction will have retrieved an invalid row.
43cdf0e10cSrcweir	 */
44cdf0e10cSrcweir	const long READ_UNCOMMITTED 	=  1;
45cdf0e10cSrcweir
46cdf0e10cSrcweir	/** Dirty reads are prevented; non-repeatable reads and phantom
47cdf0e10cSrcweir		     reads can occur.  This level only prohibits a transaction
48cdf0e10cSrcweir		     from reading a row with uncommitted changes in it.
49cdf0e10cSrcweir	 */
50cdf0e10cSrcweir	const long READ_COMMITTED		=  2;
51cdf0e10cSrcweir
52cdf0e10cSrcweir	/** Dirty reads and non-repeatable reads are prevented; phantom
53cdf0e10cSrcweir		     reads can occur.  This level prohibits a transaction from
54cdf0e10cSrcweir		     reading a row with uncommitted changes in it, and it also
55cdf0e10cSrcweir		     prohibits the situation where one transaction reads a row,
56cdf0e10cSrcweir		     a second transaction alters the row, and the first transaction
57cdf0e10cSrcweir		     rereads the row, getting different values the second time
58cdf0e10cSrcweir		     (a "non-repeatable read").
59cdf0e10cSrcweir	 */
60cdf0e10cSrcweir	const long REPEATABLE_READ 		=  4;
61cdf0e10cSrcweir
62cdf0e10cSrcweir	/** Dirty reads, non-repeatable reads and phantom reads are prevented.
63cdf0e10cSrcweir		     This level includes the prohibitions in
64cdf0e10cSrcweir		     <code>REPEATABLE_READ</code>
65cdf0e10cSrcweir			 and further prohibits the
66cdf0e10cSrcweir		     situation where one transaction reads all rows that satisfy
67cdf0e10cSrcweir		     a WHERE condition, a second transaction inserts a row that
68cdf0e10cSrcweir		     satisfies that WHERE condition, and the first transaction
69cdf0e10cSrcweir		     rereads for the same condition, retrieving the additional
70cdf0e10cSrcweir		     "phantom" row in the second read.
71cdf0e10cSrcweir	 */
72cdf0e10cSrcweir	const long SERIALIZABLE 		=  8;
73cdf0e10cSrcweir};
74cdf0e10cSrcweir
75cdf0e10cSrcweir//=============================================================================
76cdf0e10cSrcweir
77cdf0e10cSrcweir}; }; }; };
78cdf0e10cSrcweir
79cdf0e10cSrcweir/*===========================================================================
80cdf0e10cSrcweir===========================================================================*/
81cdf0e10cSrcweir#endif
82