You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Venkataganesh Thoppae <tk...@gmail.com> on 2013/01/16 15:53:16 UTC

Read Only Query

Environment: OpenJPA 2.1 with Websphere 7.1/DB2.

When one user is attempting to update a table, and another user is
attempting to read the same table (with no intent to update), we are
running into OptimisticLockException.

If the read-only user used a native query with 'FOR FETCH ONLY with UR', we
are just fine. I am looking for an option with JPA which can impart the
same behavior, so far I have found none.

query.setReadLockMode() doesn't seem to work.

App Server isolation level is READ COMMITTED. And our tables are
non-versioned.

Any thoughts would be helpful

Re: Read Only Query

Posted by Rick Curtis <cu...@gmail.com>.
It looks like this is an open JIRA[1] that has some changes already
committed... since you're using WAS, I'd suggest going through support to
see about getting an iFix.

Thanks,
Rick

[1] https://issues.apache.org/jira/browse/OPENJPA-2235


On Wed, Jan 16, 2013 at 8:53 AM, Venkataganesh Thoppae
<tk...@gmail.com>wrote:

> Environment: OpenJPA 2.1 with Websphere 7.1/DB2.
>
> When one user is attempting to update a table, and another user is
> attempting to read the same table (with no intent to update), we are
> running into OptimisticLockException.
>
> If the read-only user used a native query with 'FOR FETCH ONLY with UR', we
> are just fine. I am looking for an option with JPA which can impart the
> same behavior, so far I have found none.
>
> query.setReadLockMode() doesn't seem to work.
>
> App Server isolation level is READ COMMITTED. And our tables are
> non-versioned.
>
> Any thoughts would be helpful
>



-- 
*Rick Curtis*