Package jakarta.ejb

Annotation Type Lock


  • @Target({TYPE,METHOD})
    @Retention(RUNTIME)
    public @interface Lock
    Declares a concurrency lock for a singleton session bean with container managed concurrency.

    This annotation may be specified on the bean class, the business methods of the bean class or both. Specifying the annotation on a business method overrides the value specified at class level, if any.

    If this annotation is not used, a value of Lock(WRITE) is assumed.

    Since:
    EJB 3.1
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      LockType value
      value.
    • Element Detail

      • value

        LockType value

        value.

        Returns:
        a LockType object.
        Default:
        jakarta.ejb.LockType.WRITE