Changes between Version 2 and Version 3 of FDORfc37


Ignore:
Timestamp:
06/09/09 19:54:13 (15 years ago)
Author:
leaf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc37

    v2 v3  
    2828
    2929FdoException is the root class for FDO exception handling. Currently FDO provides less than 10 exception classes derived from FdoException. So it is difficult for users to get the accurate error information so that they can take some actions according to exception type instead of just showing an error message. More exception classes will be provided in this RFC.
     30
    3031However, it is impossible for FDO exception classes to cover all exception type. For some FDO data sources such as Oracle and SQL Server, they already return their native error code to FDO provider when encountering errors. If FDO can return the native error code to users, users may be able to handle it properly. For exmaple,
    3132
     
    3334try
    3435{
    35 . . . . . .
     36    ......
    3637}
    3738catch (FdoException* e)
    3839{
    39 FdoInt64 errorCode = e->GetNativeErrorCode();
    40 e->Release();
    41 // Take some measures according to native error code
    42 . . . . . .
     40    FdoInt64 errorCode = e->GetNativeErrorCode();
     41    e->Release();
     42    // Take some measures according to native error code
     43    ......
    4344}
    4445}}}
     
    4647== Proposed Solution ==
    4748
    48 The following methods will be added to class FdoException to return native error code. Providers will be updated to assign native error code when a FDO exception is created. If there is no native error code assigned, the default value is 0.
     49The following methods will be added to class FdoException to return native error code. Providers will be updated to assign native error code when a FDO exception is created. If there is no native error code assigned, the default value is 0.
     50
     51{{{
     52class FdoException : public FdoIDisposable
     53{
     54public:
     55    /// \brief
     56    /// Returns an instance of a FdoException using the specified arguments.
     57    ///
     58    /// \param message
     59    /// Input the error message
     60    /// \param nativeErrorCode
     61    /// Input the native error code, which is returned by FDO data source.
     62    ///
     63    /// \return
     64    /// Returns the FdoException object
     65    ///
     66    FDO_API_COMMON static FdoException* Create(FdoString* message, FdoInt64 nativeErrorCode);
     67
     68    /// \brief
     69    /// Returns an instance of a FdoException using the specified arguments.
     70    ///
     71    /// \param message
     72    /// Input the error message
     73    /// \param cause
     74    /// Input the cause of the error.
     75    /// \param nativeErrorCode
     76    /// Input the native error code, which is returned by FDO data source.
     77    ///
     78    /// \return
     79    /// Returns the FdoException object
     80    ///
     81    FDO_API_COMMON static FdoException* Create(FdoString* message, FdoException* cause, FdoInt64 nativeErrorCode);
     82
     83    /// \brief
     84    /// Gets the native error code returned from FDO data source
     85    ///
     86    /// \return
     87    /// Returns the native error code
     88    ///
     89    FDO_API_COMMON virtual FdoInt64 GetNativeErrorCode();
     90}
     91}}}
     92
     93The following exception classes will be added to FDO API. In the following class diagram, ones with white color are the existing classes and ones with light green color are the new ones. There are no any new methods added to those new exception classes. All of methods are inherited from FdoIException.
     94
     95The description of new exception classes above are as follows.
     96
     97    - FdoNotConnectedException: The FdoNotConnectedException class is the exception type thrown from classes in the Data package. This exception is thrown whenever executing an operation which requires FDO connection is connected, but FDO connection isn’t connected.
     98    - FdoWrongConnectionParamValueException: The FdoWrongConnectionParamValueException class is the exception type thrown from classes in the Connections package. This exception is thrown whenever connecting datastore with invalid connection parameters. The message should always mention which parameters were invalid.
     99    - FdoInsufficentPrivilegesException: The FdoInsufficentPrivliegesException class is the exception type thrown from classes in the Connections package. This exception is thrown whenever connecting a FDO data source without sufficient privileges.
     100    - FdoSQLCommandException: The FdoSQLCommandException class is the exception type thrown from class FdoISQLCommand.
     101    - FdoInvalidSQLStatementException: The FdoInvalidSQLStatementException class is the exception type thrown from class FdoISQLCommand. This exception is thrown whenever executing an invalid SQL statement.
     102    - FdoConstraintException: The FdoConstraintException class is the exception type thrown from classes editing property values of datastore.
     103    - FdoNullPropertyValueException: The FdoNullPropertyValueException class is the exception type thrown from classes editing property values of datastore. This exception is thrown whenever setting a non-nullable property value to null.
     104    - FdoOutOfRangePropertyValueException: The FdoOutOfRangePropertyValueException class is the exception type thrown from classes editing property values of datastore. This exception is thrown whenever setting the property value to one which violates constraint FdoPropertyValueConstraintRange.
     105    - FdoNotUniquePropertyValueException: The FdoNotUniquePropertyValueException class is the exception type thrown from classes editing property values of datastore. This exception is thrown whenever setting the property value to one which isn’t unique.
     106    - FdoNotInListPropertyValueException: The FdoNotInListPropertyValueException class is the exception type thrown from classes editing property values of datastore. This exception is thrown whenever setting the property value to one which violates constraint FdoPropertyValueConstraintList.
     107    - FdoSchemaDoesNotExistException: The FdoSchemaDoesNotExistException class is the exception type thrown from classes in the Data and Schema packages. This exception is thrown whenever the specified schema doesn’t exist.
     108    - FdoSchemaAlreadyExistsException: The FdoSchemaDoesNotExistException class is the exception type thrown from classes FdoIApplySchema. This exception is thrown whenever creating a schema which already exists.
     109    - FdoClassDoesNotExistException: The FdoClassDoesNotExistException class is the exception type thrown from classes in the Data and Schema packages. This exception is thrown whenever the specified class doesn’t exist.
     110    - FdoClassAlreadyExistsException: The FdoClassAlreadyExistsException class is the exception type thrown from classes FdoIApplySchema. This exception is thrown whenever creating a class which already exists.
     111    - FdoPropertyDoesNotExistException: The FdoClassDoesNotExistException class is the exception type thrown from classes in the Data and Schema packages. This exception is thrown whenever the specified class doesn’t exist.
     112    - FdoPropertyAlreadyExistsException: The FdoClassAlreadyExistsException class is the exception type thrown from classes FdoIApplySchema. This exception is thrown whenever creating a class which already exists.
    49113
    50114== Managed FDO API ==