# isolation.hxx

    00001 /*-------------------------------------------------------------------------
    00002  *
    00003  *   FILE
    00004  *      pqxx/isolation.hxx
    00005  *
    00006  *   DESCRIPTION
    00007  *      definitions of transaction isolation levels
    00008  *   Policies and traits describing SQL transaction isolation levels
    00009  *   DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/isolation instead.
    00010  *
    00011  * Copyright (c) 2003-2008, Jeroen T. Vermeulen <jtv@xs4all.nl>
    00012  *
    00013  * See COPYING for copyright license.  If you did not receive a file called
    00014  * COPYING with this source code, please notify the distributor of this mistake,
    00015  * or contact the author.
    00016  *
    00017  *-------------------------------------------------------------------------
    00018  */
    00019 #ifndef PQXX_H_ISOLATION
    00020 #define PQXX_H_ISOLATION
    00021
    00022 #include "pqxx/compiler-public.hxx"
    00023 #include "pqxx/compiler-internal-pre.hxx"
    00024
    00025 #include "pqxx/util"
    00026
    00027 namespace pqxx
    00028 {
    00029
    00031
    00039 enum isolation_level
    00040 {
    00041   // read_uncommitted,
    00042   read_committed,
    00043   // repeatable_read,
    00044   serializable
    00045 };
    00046
    00048 template<isolation_level LEVEL> struct isolation_traits
    00049 {
    00050   static isolation_level level() throw () { return LEVEL; }
    00051   static const char *name() throw ();
    00052 };
    00053
    00054
    00055 template<> inline const char *isolation_traits<read_committed>::name() throw ()
    00056         { return "READ COMMITTED"; }
    00057 template<> inline const char *isolation_traits<serializable>::name() throw ()
    00058         { return "SERIALIZABLE"; }
    00059
    00060 }
    00061
    00062
    00063 #include "pqxx/compiler-internal-post.hxx"
    00064
    00065 #endif
    00066