I have a Java
application and have created a Repository
class to query my Oracle
Database.
The persistence query
below that I am using is causing an error.
Query:
Query query = persistence.entityManager().createNativeQuery("Select * from PERSON WHERE ID = ?");
query.setParameter(1, id);
The error I am getting is:
Error : Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1javax.persistence.OptimisticLockException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
What could be causing this, and how can I solve it?