[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Pessimistice locking hint - hanging locks

It is possible to place locks during querying using the Eclipselink JPA enhancement "pessimistic lock hint".
http://blogs.sun.com/enterprisetechtips/entry/preventing_non_repeatable_reads_in

When you do this without having started the EM's transaction, Eclipselink starts a JDBC transaction to the database and does a select-for-update instead of a regular select.
The JDBC transaction is required, because that determines how long locks are held; upon commit or rollback and "for update" locks are released.

However, the EM's transaction is not started (getTransaction().isActive() returns false), so if you do not start the EM's transaction, the locks are never released.

Is there any way to release these for-update locks without starting the EM's transaction?