Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BB71A9FBB03 for ; Fri, 13 Jul 2007 15:06:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 34483-05 for ; Fri, 13 Jul 2007 15:06:08 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from bay0-omc3-s28.bay0.hotmail.com (bay0-omc3-s28.bay0.hotmail.com [65.54.246.228]) by postgresql.org (Postfix) with ESMTP id D7D729FB700 for ; Fri, 13 Jul 2007 15:06:12 -0300 (ADT) Received: from hotmail.com ([65.54.169.80]) by bay0-omc3-s28.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Fri, 13 Jul 2007 11:06:06 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 13 Jul 2007 11:06:05 -0700 Message-ID: Received: from 71.219.238.24 by BAY114-DAV8.phx.gbl with DAV; Fri, 13 Jul 2007 18:06:04 +0000 X-Originating-IP: [71.219.238.24] X-Originating-Email: [michaelmschmidt@msn.com] X-Sender: michaelmschmidt@msn.com From: "Michael Schmidt" To: "Mark Lewis" Cc: "PostgreSQL JDBC" References: <1184335353.387.271.camel@archimedes> Subject: Re: backup through Java Date: Fri, 13 Jul 2007 12:02:42 -0600 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01C7C545.B75D7880" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: MSN 9 X-MimeOLE: Produced By MSN MimeOLE V9.50.0039.1900 Seal-Send-Time: Fri, 13 Jul 2007 12:02:42 -0600 X-OriginalArrivalTime: 13 Jul 2007 18:06:05.0927 (UTC) FILETIME=[7B551770:01C7C578] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/52 X-Sequence-Number: 17226 This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C7C545.B75D7880 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mr. Lewis, When it wasn't working, it would just hang. This happened either when = the backup file was initially created (0 bytes on disk) or after it was = completed. Based on your comments, I looked at my BufferedReader code. = I found a comment on the Web that the CharSet should always be specified = for the InputStreamReader, which I hadn't done. I specified it as = "US-ASCII" and backup hasn't hung since. Maybe that fixed it! Thanks for your thoughts! Michael Schmidt ----- Original Message -----=20 From: Mark Lewis=20 To: Michael Schmidt=20 Cc: PostgreSQL JDBC=20 Sent: Friday, July 13, 2007 8:02 AM Subject: Re: [JDBC] backup through Java When it doesn't work, how does it not work? If you see pg-dump.exe is still running but not doing anything, then = it might be because it generated more output to stdout than will fit in = the buffer, and you're not reading it. One common mistake is to forget to read stdout/stderr from the process. -- Mark On Thu, 2007-07-12 at 18:01 -0600, Michael Schmidt wrote: > Folks, > I know this isn't technically a JDBC question because backup isn't > done through JDBC, but I thought this is where the Java experts = would > be. > =20 > I've got a Java application developed in Eclipse interfacing a > PostgreSQL 8.2.1 database. The user can do a backup using = pg-dump.exe > - the Java code invokes this as an external process in a thread = (Jobs > interface, in Eclipse parlance). This works some of the time - but > not always. Since it works sometimes, I think the Java code that > invokes pg_dump.exe is basically OK, but since it hangs at other > times, there is obviously something bad going on. I don't know = where > to start looking for problems. I was wondering if anyone had seen > similar behavior (Java is usually pretty predictable in my = experience) > or had some thoughts on where the problem could lie so I could at > least begin debugging my app. =20 > =20 > Thanks! > Michael Schmidt ------=_NextPart_000_0006_01C7C545.B75D7880 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Mr. Lewis,
 
When it wasn't working, it would just hang.  This happened = either when=20 the backup file was initially created (0 bytes on disk) or after it was=20 completed.  Based on your comments, I looked at my = BufferedReader=20 code.  I found a comment on the Web that the CharSet should always = be=20 specified for the InputStreamReader, which I hadn't done.  I = specified it=20 as "US-ASCII" and backup hasn't hung since.  Maybe that fixed = it!
 
Thanks for your thoughts!
 
Michael Schmidt
----- Original Message -----
From: Mark Lewis
To: Michael Schmidt
Cc: PostgreSQL JDBC
Sent: Friday, July 13, 2007 = 8:02 AM
Subject: Re: [JDBC] backup = through=20 Java

When it doesn't work, how does it not work?

If = you see=20 pg-dump.exe is still running but not doing anything, then it
might = be=20 because it generated more output to stdout than will fit in = the
buffer, and=20 you're not reading it.  One common mistake is to forget = to
read=20 stdout/stderr from the process.

-- Mark

On Thu, = 2007-07-12 at=20 18:01 -0600, Michael Schmidt wrote:
> Folks,
> I know this = isn't=20 technically a JDBC question because backup isn't
> done through = JDBC,=20 but I thought this is where the Java experts would
> = be.
> =20
> I've got a Java application developed in Eclipse interfacing=20 a
> PostgreSQL 8.2.1 database.  The user can do a backup = using=20 pg-dump.exe
> - the Java code invokes this as an external = process in a=20 thread (Jobs
> interface, in Eclipse parlance).  This works = some of=20 the time - but
> not always.  Since it works sometimes, I = think the=20 Java code that
> invokes pg_dump.exe is basically OK, but since = it hangs=20 at other
> times, there is obviously something bad going = on.  I=20 don't know where
> to start looking for problems.  I was = wondering=20 if anyone had seen
> similar behavior (Java is usually pretty=20 predictable in my experience)
> or had some thoughts on where = the=20 problem could lie so I could at
> least begin debugging my = app. =20
> 
> Thanks!
> Michael=20 Schmidt
------=_NextPart_000_0006_01C7C545.B75D7880--