Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-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 D71AB17D83 for ; Tue, 14 Jul 2015 13:55:39 +0000 (UTC) Received: (qmail 44689 invoked by uid 500); 14 Jul 2015 13:55:39 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 44654 invoked by uid 500); 14 Jul 2015 13:55:39 -0000 Mailing-List: contact users-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.incubator.apache.org Delivered-To: mailing list users@groovy.incubator.apache.org Received: (qmail 44644 invoked by uid 99); 14 Jul 2015 13:55:39 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2015 13:55:39 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3FE301801DB for ; Tue, 14 Jul 2015 13:55:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id N8P2whoSeC4q for ; Tue, 14 Jul 2015 13:55:38 +0000 (UTC) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com [209.85.160.169]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id F0E402092B for ; Tue, 14 Jul 2015 13:55:37 +0000 (UTC) Received: by ykdu72 with SMTP id u72so8281376ykd.2 for ; Tue, 14 Jul 2015 06:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=pHTukRWAQHYVxEcvj2PabsNME0hvzAjEiHCCR41RxSQ=; b=YfD8iuhEnZ1jTMoAJ4q6eS5fiCt4hN3+8nL/j8oYHLHS8kLlZDNmoHglhtHEjdtXUG 7geNi4g167l15eZWXjUb4ddXg63dwHXUBrrgJlXJnN+WYJjdUg9ItNLN2KnFUlyoGtC9 OKtlnTigLRfoKPzAAl2d8LJga+TfTF8vFvFjkOgmXzsJNrVIZGzY3qy/EF3HsyBj9T1F vxWIsV01++gWzTY0DVV9J/nQ83HZ9gu9+ZfTsuyzgA+Xhf3kdWRzN1hsZJTzD6PuKNO6 3l4LfGMP7kLYHgjNfZpeQwJJdtFic7Fse1Iyf4LiBMNxRmIbDapvgAuN3uoJ6khK3FtD QcVg== MIME-Version: 1.0 X-Received: by 10.170.136.131 with SMTP id d125mr43875784ykc.59.1436882047142; Tue, 14 Jul 2015 06:54:07 -0700 (PDT) Received: by 10.129.34.139 with HTTP; Tue, 14 Jul 2015 06:54:07 -0700 (PDT) In-Reply-To: References: Date: Tue, 14 Jul 2015 06:54:07 -0700 Message-ID: Subject: Re: Groovy Script withBatch() Hang? From: Owen Rubel To: users@groovy.incubator.apache.org Content-Type: multipart/alternative; boundary=001a11397562012dcb051ad62cda --001a11397562012dcb051ad62cda Content-Type: text/plain; charset=UTF-8 If hangs are always happening on end of batch, you are probably not closing something. Owen Rubel 415-971-0976 orubel@gmail.com On Tue, Jul 14, 2015 at 6:20 AM, Daniel Price wrote: > Groovy script withBatch() is still hanging... > > Database trace and activity monitor do not indicate any locks, and all > data is inserted/updated as expected, so this doesn't seem to be a DB > issue... > > I'm wondering why I'm not seeing a non-empty return from my batch code: > > myList = [['a','b'],['c','d']] > > def result = sql.withBatch(someInt, "insert into myDB.dbo.myTable > (column1, column2) values (?,?)"){ ps -> > myList.each{ > ps.addBatch(it) > } > ps.executeBatch() > } > println "result: " + result > > prints: > result: [] > > Shouldn't result == [1] * myList.size()? > > Hangs always happen upon completion of the batch... > > Regards, > D > > > > On Mon, Jul 13, 2015 at 4:06 PM, Daniel Price > wrote: > >> Good Afternoon, >> >> I'm experiencing infrequent (1/20) hangs with a Groovy script that >> uses withBatch() to insert and update a SQL Server DB using stored >> procedures. In each case (insert or update), the batch completes as >> indicated by database content, but the script hangs and does not continue >> until I ctrl-c it. This script is the only user of the table, so DB >> locking isn't involved. The batches are only about 200k rows, but I set >> the withBatch() parameter to 25k to be nice to the DB. Has anybody seen >> this before? Any suggestions? Thanks! >> >> D >> > > --001a11397562012dcb051ad62cda Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
If hangs are always happening on end of batch, you are pro= bably not closing something.

Owen Rubel
415-971-0976
orubel@gmail.com
=

On Tue, Jul 14, 2015 at 6:20 AM, Daniel Pric= e <danprice303@gmail.com> wrote:
Groovy script withBatch() is still hanging= ...

Database trace and activity monitor do not indicate= any locks, and all data is inserted/updated as expected, so this doesn'= ;t seem to be a DB issue...

I'm wondering why I'= m not seeing a non-empty return from my batch code:

myList =3D [['a','b'],['c','d']]

def result =3D sql.withBatch(someInt, "insert in= to myDB.dbo.myTable (column1, column2) values (?,?)"){ ps ->
<= div>=C2=A0 =C2=A0myList.each{
=C2=A0 =C2=A0 =C2=A0 ps.addBatch(it= )
=C2=A0 =C2=A0}
=C2=A0 =C2=A0ps.executeBatch()
}
println "result: " + result

prints:
result: []

Shouldn'= t result =3D=3D [1] * myList.size()?

Hangs always happen upon complet= ion of the batch...

Regards,
D

=
=C2=A0

On Mon, Jul 13, 2015 at 4:06 PM, Daniel Price <danprice303= @gmail.com> wrote:
Good Afternoon,

=C2=A0 =C2=A0 =C2=A0I'm exp= eriencing infrequent (1/20) hangs with a Groovy script that uses withBatch(= ) to insert and update a SQL Server DB using stored procedures.=C2=A0 In ea= ch case (insert or update), the batch completes as indicated by database co= ntent, but the script hangs and does not continue until I ctrl-c it.=C2=A0 = This script is the only user of the table, so DB locking isn't involved= .=C2=A0 The batches are only about 200k rows, but I set the withBatch() par= ameter to 25k to be nice to the DB.=C2=A0 Has anybody seen this before?=C2= =A0 Any suggestions?=C2=A0 Thanks!
=
D =C2=A0 =C2=A0 =C2=A0=C2=A0


--001a11397562012dcb051ad62cda--