Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 406BFD47C for ; Tue, 28 May 2013 13:49:04 +0000 (UTC) Received: (qmail 97361 invoked by uid 500); 28 May 2013 13:49:04 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 96906 invoked by uid 500); 28 May 2013 13:48:58 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 96869 invoked by uid 99); 28 May 2013 13:48:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 13:48:57 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kwsutter@gmail.com designates 209.85.215.47 as permitted sender) Received: from [209.85.215.47] (HELO mail-la0-f47.google.com) (209.85.215.47) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 May 2013 13:48:50 +0000 Received: by mail-la0-f47.google.com with SMTP id fq12so7342986lab.6 for ; Tue, 28 May 2013 06:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ckqqM1BBq6HLDpaa19SN18iEA851Un5fD0dFBOeEHrw=; b=hzSn/CC174pZN/kUC1XvK1V3eXGtCLUkgDM1s3Rz702BNpW9r6b7RJ14ep2CsMlctz PjDhKjxskoJC0rTfEfB3YBLHa0zG/uOtZ0dQQnxeKJz5s5u3zrHhcu8z9FvjPDx9Aj1H e161EinLCmbESjRBPTtD07eZO84XWGU9DYRLp1jXtjh3uJDrQncIkFAiy5yRXBvng66w ON+4qQ5vOeNuP8tAitikAa8MFBSjZrwDRrbXhfgeMUoAsx+bg/A/30Y754A5QwVj6kSW M7aKSFXmo0Hbl0peItDDtw9aqEVKzeKb3SoNTYKCUEnK/kyy9r2kDWGq4ZuxlZA8cfKl Q31g== X-Received: by 10.112.72.132 with SMTP id d4mr16603306lbv.79.1369748909778; Tue, 28 May 2013 06:48:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.159.135 with HTTP; Tue, 28 May 2013 06:48:09 -0700 (PDT) In-Reply-To: References: From: Kevin Sutter Date: Tue, 28 May 2013 08:48:09 -0500 Message-ID: Subject: Re: How to define a timeout for nativeQuery by OpenJPA 1.2.2 To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=001a11c23f6432eb3f04ddc785cb X-Virus-Checked: Checked by ClamAV on apache.org --001a11c23f6432eb3f04ddc785cb Content-Type: text/plain; charset=ISO-8859-1 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 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 > * > ** > --001a11c23f6432eb3f04ddc785cb--