openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu wang <wangy...@gmail.com>
Subject How to define a timeout for nativeQuery by OpenJPA 1.2.2
Date Mon, 27 May 2013 06:12:31 GMT
*
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