openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: How to define a timeout for nativeQuery by OpenJPA 1.2.2
Date Tue, 28 May 2013 13:48:09 GMT
Hi Yu Wang,
I'm not clear on what you are trying to demonstrate.  The OpenJPA junit
bucket does have some tests for the various timeout hints and their usage
with finders and queries.  If you can further explain what your expected
results should be (via a junit?), it would be helpful.  Thanks,

Kevin


On Mon, May 27, 2013 at 1:12 AM, yu wang <wangyumi@gmail.com> wrote:

> *
> I found *
> *javax.persistence.query.timeout
>  does not work.
>
> query = manager.createNativeQuery(sql, Mybean.class);
>
>         query.setHint("openjpa.FetchPlan.LockTimeout", new Integer(30000));
>         query.setHint("javax.persistence.lock.timeout", new
> Integer(30000));
>         query.setHint("javax.persistence.query.timeout", new
> Integer(30000));
>
>         if (TsamLogger.isInfoEnabled(log)) {
>           start_time = System.currentTimeMillis();
>         }
>         reslist = query.getResultList();
>
> *
> *Regards,
> Yu Wang
> *
> **
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message