When trying to use the method below in the DAO class:
public boolean validaMatricula(String matricula) throws SQLException {
Usuario usuario = manager.find(Usuario.class, matricula);
if(usuario != null) {
return true;
}
return false;
}
You are returning the following error:
Message Request processing failed; nested exception is org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOnly
SERVICE class:
@Service
public class Service{
public boolean validaMatricula(String matricula) throws SQLException {
return dao.validaMatricula(matricula);
}
}