Hi Romain!

Yes I did so:
entityManager.setProperty( "javax.persistence.lock.timeout", (int) timeout );
entityManager.lock( entity, LockModeType.PESSIMISTIC_WRITE );

Best regards,
                Thomas


Von: Romain Manni-Bucau [via OpenEJB] 
[mailto:[email protected]]
Gesendet: Mittwoch, 23. Oktober 2013 14:24
An: Thomas Schuler
Betreff: Re: No transaction rollback in case of pessimistic locking failure

Hi

did you set javax.persistence.lock.timeout property?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/10/23 tschuler <[hidden 
email]</user/SendEmail.jtp?type=node&node=4665711&i=0>>:

> Hi!
>
> We are using TomEE 1.6.0 snapshot and are actually working on usage of
> pessimistic locks for an entity (entityManager.lock(entity,
> LockModeType.PESSIMISTIC_WRITE)).
>
> What we see is that if the entity is allready locked the next locking
> attempt results in a PessimisticLockException marking the transaction for
> rollback.
>
> Is there a way to avoid the transaction rollback (or to get a
> LockTimeoutException instead that seems to have no effect on the transaction
> state)?
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context: 
> http://openejb.979440.n4.nabble.com/No-transaction-rollback-in-case-of-pessimistic-locking-failure-tp4665710.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

________________________________
If you reply to this email, your message will be added to the discussion below:
http://openejb.979440.n4.nabble.com/No-transaction-rollback-in-case-of-pessimistic-locking-failure-tp4665710p4665711.html
To unsubscribe from No transaction rollback in case of pessimistic locking 
failure, click 
here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665710&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjU3MTB8LTE4NTIyNTQ0OTI=>.
NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: 
http://openejb.979440.n4.nabble.com/No-transaction-rollback-in-case-of-pessimistic-locking-failure-tp4665710p4665712.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to