Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 4359 invoked from network); 3 Feb 2009 16:30:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2009 16:30:53 -0000 Received: (qmail 13456 invoked by uid 500); 3 Feb 2009 16:30:46 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 13428 invoked by uid 500); 3 Feb 2009 16:30:46 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 13393 invoked by uid 99); 3 Feb 2009 16:30:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 08:30:46 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of michael.d.dick@gmail.com designates 209.85.134.186 as permitted sender) Received: from [209.85.134.186] (HELO mu-out-0910.google.com) (209.85.134.186) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 16:30:38 +0000 Received: by mu-out-0910.google.com with SMTP id w1so71120mue.3 for ; Tue, 03 Feb 2009 08:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=u9E8RvCLilkWVbgHh9x4XzJ7FwiFSMGA5Lzl9hVO5qo=; b=pY12ki2CIw68HOU7trJ51n+ELuSNjLfPV6WHRiiwAu/kJLRPajKMkeAi5iVYQqWlgy P896hq90YQXtqxGCjLzJN1NMkA9XVTNo4SRqKbIN+048nDj1X7A0/y/CEVUOMVWVHxbP KQsG5fx6jeHhZV9YD1LpnpICPpd9Mv68E++ds= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pj9ywkw+wgmoHMCrGCOr0YoY2kTqVMspPfZ9y+nsBm6mO77ME8exoy4X90AGME822G jaSrDlJgTn5Xs73r1KMFU1iXJsjWYhHnXEcpOVdg/KW9Zmx1qyBMXjURj/M6EhwW8lFc Efa9ZBF/YeSEkiTk/ckVmt+LePMOGqKHRzF9M= MIME-Version: 1.0 Received: by 10.223.126.145 with SMTP id c17mr473883fas.102.1233678617208; Tue, 03 Feb 2009 08:30:17 -0800 (PST) In-Reply-To: <219e184e.6208015e.49882135.498bd@o2.pl> References: <219e184e.6208015e.49882135.498bd@o2.pl> Date: Tue, 3 Feb 2009 10:30:17 -0600 Message-ID: <72c1350f0902030830n418196bdndab8716a69f1324@mail.gmail.com> Subject: Re: Revision 736066 of TestMultipleSchemaNames From: Michael Dick To: dev@openjpa.apache.org Content-Type: multipart/alternative; boundary=001636c5a736bee9b10462062f08 X-Virus-Checked: Checked by ClamAV on apache.org --001636c5a736bee9b10462062f08 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Hi Milosz, Sorry about that (obviously) I didn't run that change on PostGres and I missed the comments. For now I'm going to just remove the System.err.println. Alternatively we could catch and re-throw the exception after cleaning up. Just running a sanity check build before committing. On Tue, Feb 3, 2009 at 4:49 AM, Mi=B3osz Tylenda wrote: > Hi Mike, > > I am afraid that this change (removing try/catch) will prevent running th= e > test (at least the first method) on PostgreSQL more than once. PostgreSQL > needs explicit schema creation and the try/catch code was the easiest way= I > could find to handle the case when schemas are already created. Let me kn= ow > if you think this should be done in another way. > > Also, the closing of emf at the bottom of the method should rather stay a= s > before as the emf is not used outside of the method. > > This schema creation stuff was added to harness a bug concerning > autoincrement columns in PostgreSQL. The diff follows. > > Greetings, > Milosz > > --- > openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/p= ersistence/generationtype/TestMultipleSchemaNames.java > (original) > +++ > openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/p= ersistence/generationtype/TestMultipleSchemaNames.java > Tue Jan 20 11:01:50 2009 > @@ -417,19 +417,11 @@ > String[] schemas =3D > { "SCHEMA1", "SCHEMA2", "SCHEMA3", "SCHEMA3G", "SCHEMA4G" }; > for (String schema : schemas) { > - try { > - em.getTransaction().begin(); > - Query q =3D em.createNativeQuery("create schema " + sche= ma); > - q.executeUpdate(); > - em.getTransaction().commit(); > - } catch (PersistenceException e) { > - System.err.println("Exception caught while creating sche= ma > " > - + schema + ". Schema already exists? Message: " > - + e.getMessage()); > - em.getTransaction().rollback(); > - } > + em.getTransaction().begin(); > + Query q =3D em.createNativeQuery("create schema " + schema); > + q.executeUpdate(); > + em.getTransaction().commit(); > } > - closeEMF(emf); > } > --001636c5a736bee9b10462062f08--