OFBiz
  1. OFBiz
  2. OFBIZ-3870

Extend GenericEntityExceptions and provide subclasses for different types of database errors

    Details

    • Type: Improvement Improvement
    • Status: Patch Available
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None

      Description

      Currently EntityEngine provides only GenericDuplicateKeyException which is never used.

      It is needed for development purposes to create more detailed exceptions level which allows developers to better handle
      database errors and warnings and help distinguish between recoverable and not-recoverable errors.

      This improvement provides the following classes:

      GenericIntegrityConstraintViolationException -> GenericEntityException

      GenericRestrictViolationException -> GenericIntegrityConstraintViolationException
      GenericNotNullViolationException -> GenericIntegrityConstraintViolationException
      GenericGoreignKeyViolationException -> GenericIntegrityConstraintViolationException
      GenericDuplicateKeyException -> GenericIntegrityConstraintViolationException ( modified superclass )
      GEnericCheckViolationException -> GenericIntegrityConstraintViolationException

        Activity

        Hide
        Jacques Le Roux added a comment -

        Hi Deyan,

        In this thread Adrian suggested to handle the 2 specs using the an attribute of the datasource element of entitytengine.xml. I don't find any entitytengine.xml in your patch. Did you handle it another way (I did not look into details)

        Show
        Jacques Le Roux added a comment - Hi Deyan, In this thread Adrian suggested to handle the 2 specs using the an attribute of the datasource element of entitytengine.xml. I don't find any entitytengine.xml in your patch. Did you handle it another way (I did not look into details)
        Hide
        Deyan added a comment -
        • Added more sql states
        • Added sql state constants javadoc
        • Added GenericDeleteConstraintViolationException
        • Removed inner class SQLStateConstants.SQL2003, as SQL:2003 and x/open states seem to be compatible
        Show
        Deyan added a comment - Added more sql states Added sql state constants javadoc Added GenericDeleteConstraintViolationException Removed inner class SQLStateConstants.SQL2003, as SQL:2003 and x/open states seem to be compatible
        Hide
        Deyan added a comment -

        No need to add an attribute of the datasource element in entityengine.xml as this info is provided by jdbc.

        SQLProcessor:116
        this._sqlStateType = connection.getMetaData().getSQLStateType();

        Also it seems like x/open and sql:2003 states are compatible:

        http://ieeexplore.ieee.org/Xplore/login.jsp?url=http://ieeexplore.ieee.org/iel2/330/3600/00128794.pdf%3Farnumber%3D128794&authDecision=-203

        The SQL (structured query language) Access Group, an open industry consortium that includes many major SQL database vendors and a number of database tool developers, is developing a common embedded SQL language interface for client-server interoperability in OSI (open systems interconnection) environments. This specification covers most of the features in the current ANSI/ISO SQL standard, includes some new features from the proposed SQL2 standard, and maintains upward compatibility with X/Open applications. As part of this development process, SQL Access has seen the need for enhancements to SQL for remote access and has contributed to the ANSI and ISO standardization efforts. X/Open is a member of the SQL Access Group and enjoys an excellent working relationship in extending the X-Open specification to include SQL Access Group requirements

        Show
        Deyan added a comment - No need to add an attribute of the datasource element in entityengine.xml as this info is provided by jdbc. SQLProcessor:116 this._sqlStateType = connection.getMetaData().getSQLStateType(); Also it seems like x/open and sql:2003 states are compatible: http://ieeexplore.ieee.org/Xplore/login.jsp?url=http://ieeexplore.ieee.org/iel2/330/3600/00128794.pdf%3Farnumber%3D128794&authDecision=-203 The SQL (structured query language) Access Group, an open industry consortium that includes many major SQL database vendors and a number of database tool developers, is developing a common embedded SQL language interface for client-server interoperability in OSI (open systems interconnection) environments. This specification covers most of the features in the current ANSI/ISO SQL standard, includes some new features from the proposed SQL2 standard, and maintains upward compatibility with X/Open applications. As part of this development process, SQL Access has seen the need for enhancements to SQL for remote access and has contributed to the ANSI and ISO standardization efforts. X/Open is a member of the SQL Access Group and enjoys an excellent working relationship in extending the X-Open specification to include SQL Access Group requirements
        Hide
        Jacques Le Roux added a comment -

        Thanks Deyan,

        Looking forward for Adam's review...

        Show
        Jacques Le Roux added a comment - Thanks Deyan, Looking forward for Adam's review...
        Hide
        Deyan added a comment -

        Hi guys,

        any progress ?

        Show
        Deyan added a comment - Hi guys, any progress ?
        Hide
        Jacques Le Roux added a comment -

        Hi Deyan,

        Thanks to care, I guess Adam is in holidays I have not seen any messages from him for a while. I'd prefer that he had a look because he already expressed some suggestions and concerns...

        Show
        Jacques Le Roux added a comment - Hi Deyan, Thanks to care, I guess Adam is in holidays I have not seen any messages from him for a while. I'd prefer that he had a look because he already expressed some suggestions and concerns...

          People

          • Assignee:
            Adam Heath
            Reporter:
            Deyan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development