Skip to content

Clarify whether rollbackOn accepts Throwables and improve typesafety #223

@gavinking

Description

@gavinking

It's unclear from the spec and Javadoc whether an "exception" specified by rollbackOn or dontRollbackOn must descend from Exception, or whether it may be any sort of Throwable. This problem is made far worse because these annotations members are not type safe, and declared using raw types, allowing the user to write nonsensical things like @Transactional(rollbackOn=Object.class).

It should be clarified whether stuff like @Transactional(rollbackOn=Error.class) is allowed, and the annotation members should be fixed to have a correct upper bound on the Class type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions