Error performing "FIND" with Hibernate - Spring MVC

0

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);
    }
}
    
asked by anonymous 27.09.2018 / 17:37

0 answers