About NonUniqueResultException

api-jpa

javax.persistence.NonUniqueResultException

Thrown by the persistence provider when Query.getSingleResult() or TypedQuery.getSingleResult() is executed on a query and there is more than one result from the query.(Exception of JPA)

 
manual

Running JPA Queries

Explains how to use JPA to run Java Persistence Query Language (JPQL) queries.... with the name 'Canada' (e.g. due to a bug) a NonUniqueResultException javax.persistence.NonUniqueResultException JPA exception Thrown by the persistence ...

 
api-jpa

JPA Exceptions

Reference (JavaDoc) of the JPA exception classes, including PersistenceException, EntityExistsException, EntityNotFoundException, LockTimeoutException, NonUniqueResultException, NoResultException, OptimisticLockException, PessimisticLockException, QueryTimeoutException, RollbackException, TransactionRequiredException.... javax.persistence.NonUniqueResultException ... or during query execution: javax.persistence.NonUniqueResultException javax.persistence.NoResultException ...

 
api-jpa

NonUniqueResultException()

Constructs a new NonUniqueResultException exception with null as its detail message.(Constructor of javax.persistence.NonUniqueResultException)

 
api-jpa

NonUniqueResultException(message)

Constructs a new NonUniqueResultException exception with the specified detail message.(Constructor of javax.persistence.NonUniqueResultException)

 
api-jpa

javax.persistence.PersistenceException

Thrown by the persistence provider when a problem occurs.(Exception of JPA)

 
api-jpa

javax.persistence.TypedQuery

Interface used to control the execution of typed queries.(Interface of JPA)

 
forum_thread

Optimistic lock failed

Hi, I frequently see exceptions during development such as com.objectdb.o._RollbackException: Failed to commit transaction: Optimistic lock failed for object com.example.MyEntity#3 (object has version 1 instead of 3) Could you please explain what this means, and what I can do about it. Thanks you, Carl     ... EntityNotFoundException, LockTimeoutException, NonUniqueResultException, NoResultException, OptimisticLockException, ...

 
api-jpa

getSingleResult()

Execute a SELECT query that returns a single untyped result.(Method of javax.persistence.Query)

 
api-jpa

getSingleResult()

Execute a SELECT query that returns a single result.(Method of javax.persistence.TypedQuery)