00001 /* 00002 00003 Copyright (c) 2002-2005, Yauheni Akhotnikau 00004 All rights reserved. 00005 00006 Redistribution and use in source and binary forms, with or without 00007 modification, are permitted provided that the following conditions are met: 00008 00009 - Redistributions of source code must retain the above copyright notice, this 00010 list of conditions and the following disclaimer. 00011 00012 - Redistributions in binary form must reproduce the above copyright notice, this 00013 list of conditions and the following disclaimer in the documentation and/or 00014 other materials provided with the distribution. 00015 00016 - The name of the author may not be used to endorse or promote products derived 00017 from this software without specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00020 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00021 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 00022 EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00023 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00024 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00025 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00026 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00027 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00028 OF SUCH DAMAGE. 00029 00030 */ 00031 00032 /* 00033 ObjESSty-1 00034 */ 00035 00042 #if !defined( _OESS_1__DB__SITE__IMPL__TRANSACTION_CMD_HPP_ ) 00043 #define _OESS_1__DB__SITE__IMPL__TRANSACTION_CMD_HPP_ 00044 00045 #include <oess_1/db/site/impl/h/request.hpp> 00046 #include <oess_1/db/site/impl/h/response.hpp> 00047 00048 namespace oess_1 { 00049 00050 namespace db { 00051 00052 namespace site { 00053 00054 namespace impl { 00055 00056 // 00057 // transaction_cmd_t 00058 // 00059 00064 class transaction_cmd_t : 00065 public request_t 00066 { 00067 OESS_SERIALIZER( transaction_cmd_t ) 00068 public : 00070 enum 00071 { 00072 begin = 1, 00073 commit = 2, 00074 rollback = 4 00075 }; 00076 00077 transaction_cmd_t(); 00078 transaction_cmd_t( 00080 const std::string & client_id, 00082 const std::string & db_logic_name, 00084 oess_1::uint_t op_id ); 00085 virtual ~transaction_cmd_t(); 00086 00087 enum { 00088 e_id = 1100 00089 }; 00090 00091 virtual oess_1::uint_t 00092 query_req_id() const; 00093 00095 const std::string & 00096 query_db_logic_name() const; 00097 00099 oess_1::uint_t 00100 query_op_id() const; 00101 00102 private : 00104 std::string m_db_logic_name; 00106 oess_1::uint_t m_op_id; 00107 }; 00108 00109 // 00110 // transaction_cmd_result_t 00111 // 00112 00117 class transaction_cmd_result_t : 00118 public response_t 00119 { 00120 OESS_SERIALIZER( transaction_cmd_result_t ) 00121 public : 00122 transaction_cmd_result_t(); 00124 transaction_cmd_result_t( 00125 const result_t & result ); 00126 virtual ~transaction_cmd_result_t(); 00127 00128 enum { 00129 e_id = 1101 00130 }; 00131 00132 virtual oess_1::uint_t 00133 query_resp_id() const; 00134 }; 00135 00136 } /* namespace impl */ 00137 00138 } /* namespace site */ 00139 00140 } /* namespace db */ 00141 00142 } /* namespace oess_1 */ 00143 00144 #endif