Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed nit

...

Bean validation provides three modes of operation within the JPA environment: auto, callback, and none. As you may have guessed, none disables bean validation for a particular persistence unit. The auto mode, which is the default, enables bean validation if a validation provider is available within the classpath. When callback mode is specified, a bean validation provider must be available for use by the JPA provider. If not, the JPA provider will throw an exception upon instantiation of a new JPA entity manager factory. While auto mode simplifies deployment, it can lead to problems if validation is unexpectedly not taking place due to a configuration problem. It is a good practice to use either none or callback mode explicitly in order to get consistent behavior. In addition, if none is specified, OpenJPA will do optimization at startup and will not attempt to perform unexpected validation. Explicitly disabling validation is especially important in a JEE6 environment where the container is mandated to provide a validation provider. Thus, unless specified, a JPA 2.0 app running in a container will have validation enabled. This will add additional processing during lifecycle events. We'll get to lifecycle events shortly.

...