it_bus_pdk/db_exception.h

00001 #ifndef _IT_DB_EXCEPTION_H_
00002 #define _IT_DB_EXCEPTION_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 
00007 #include <it_bus/types.h>
00008 #include <it_bus/api_defines.h>
00009 #include <it_bus/exception.h>
00010 
00011 namespace IT_Bus
00012 {
00013     // Database Exception Types
00014     //    
00015     const IT_ULong DB_EXCEPTION_CANNOT_WRITE_LOCK_FILE              = 0;
00016     const IT_ULong DB_EXCEPTION_FAILURE_DURING_GET                  = 1;
00017     const IT_ULong DB_EXCEPTION_FAILURE_DURING_PUT                  = 2;
00018     const IT_ULong DB_EXCEPTION_FAILURE_DURING_ERASE                = 3;
00019     const IT_ULong DB_EXCEPTION_FAILURE_DURING_GET_SIZE             = 4;
00020     const IT_ULong DB_EXCEPTION_COULD_NOT_CREATE_SHARED_DB_ENV      = 5;    
00021     const IT_ULong DB_EXCEPTION_COULD_NOT_OPEN_SHARED_DB_ENV        = 6;
00022     const IT_ULong DB_EXCEPTION_COULD_NOT_CREATE_DB                 = 7;
00023     const IT_ULong DB_EXCEPTION_COULD_NOT_OPEN_DB                   = 8;
00024     const IT_ULong DB_EXCEPTION_NULL_POINTER                        = 9;
00025     const IT_ULong DB_EXCEPTION_COULD_NOT_CREATE_CURSOR             = 10;
00026     const IT_ULong DB_EXCEPTION_COULD_NOT_DUP_CURSOR                = 11;
00027     const IT_ULong DB_EXCEPTION_FAILURE_DURING_GET_VALUE            = 12;
00028     const IT_ULong DB_EXCEPTION_COULD_NOT_INITIALIZE_REPLICATION    = 13;
00029     const IT_ULong DB_EXCEPTION_COULD_NOT_INIT_TXN                  = 14;
00030     const IT_ULong DB_EXCEPTION_COULD_NOT_COMMIT_TXN                = 15;
00031     const IT_ULong DB_EXCEPTION_COULD_NOT_MKDIR_DB_HOME             = 16;
00032     const IT_ULong DB_EXCEPTION_BAD_CONFIGURATION                   = 17;
00033     const IT_ULong DB_EXCEPTION_COULD_NOT_OPEN_SYNC_DB              = 18;
00034     const IT_ULong DB_EXCEPTION_COULD_NOT_CREATE_SYNC_DB            = 19;    
00035     const IT_ULong DB_EXCEPTION_COULD_NOT_WRITE_TO_SYNC_DB          = 20;    
00036     const IT_ULong DB_EXCEPTION_SYNC_DB_NOT_READY                   = 21;
00037     const IT_ULong DB_EXCEPTION_COULD_NOT_PROMOTE                   = 22;
00038     const IT_ULong DB_EXCEPTION_COULD_NOT_DEMOTE                    = 23;
00039     const IT_ULong DB_EXCEPTION_SLAVE_CANNOT_UPDATE_DB              = 24;
00040     const IT_ULong DB_EXCEPTION_LICENSE_CHECK_FAILED                = 25;
00041     const IT_ULong DB_EXCEPTION_ENV_IN_USE                          = 26;
00042     const IT_ULong DB_EXCEPTION_COULD_NOT_TRANSFER_DB_FILES         = 27;
00043     
00044     class IT_BUS_API DBException :
00045         public Exception
00046     {
00047       public:
00048         
00049         DBException(
00050             unsigned long exception_type,
00051             int           native_error_code,
00052             const char*   msg
00053         );
00054 
00055         DBException(
00056             const DBException& rhs
00057         );
00058 
00059         virtual
00060         ~DBException();
00061 
00065         virtual Exception*
00066         clone() const;
00067     
00071         virtual void
00072         rethrow() const;
00073 
00074         int
00075         native_error_code() const;
00076 
00077         IT_ULong 
00078         error() const;  
00079 
00080         const char*
00081         error_as_string() const;
00082 
00083         const char*
00084         message() const;        
00085 
00086       private:
00087 
00088         IT_ULong m_exception_type;
00089         int      m_native_error_code;
00090         String   m_message;
00091     };
00092 }
00093 
00094 #endif  

Generated on Tue Mar 20 15:27:52 2007 for Artix by  doxygen 1.5.1-p1