How o force 'select for update' with jpa hibernate

I have a jpa repository where I need to force a select for update query,

this is my code:


public DocumentTransaction findOneNonCompleted(String uuid, boolean lockForUpdate)
        TypedQuery query = getEntityManager().createQuery("SELECT t FROM DocumentTransaction t WHERE t.uuid = ?1 AND t.docStatus = TransactionStatus.PROCESSING", DocumentTransaction.class);
        if (lockForUpdate)

        List<DocumentTransaction> result = query.getResultList();



I didn't get to debug it completely, the code works but I'm not sure about locking because I keep seeing this log message from hibernate:

[timeoutScheduler-2] INFO  hibernate.ejb.AbstractQueryImpl - Ignoring unrecognized query hint [javax.persistence.lock.timeout]


which makes me think that hibernate is ignoring my hint,

any ideas someone?




Thank you for your interest!

We will contact you as soon as possible.

Send us a message

Oops, something went wrong
Please try again or contact us by email at