pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedbackup through Java
3+ messages / 2 participants
[nested] [flat]
* backup through Java
@ 2007-07-13 00:01 Michael Schmidt <michaelmschmidt@msn.com>
2007-07-13 14:02 ` Re: backup through Java Mark Lewis <mark.lewis@mir3.com>
0 siblings, 1 reply; 3+ messages in thread
From: Michael Schmidt @ 2007-07-13 00:01 UTC (permalink / raw)
To: pgsql-jdbc
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.
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.
Thanks!
Michael Schmidt
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: backup through Java
2007-07-13 00:01 backup through Java Michael Schmidt <michaelmschmidt@msn.com>
@ 2007-07-13 14:02 ` Mark Lewis <mark.lewis@mir3.com>
2007-07-13 18:02 ` Re: backup through Java Michael Schmidt <michaelmschmidt@msn.com>
0 siblings, 1 reply; 3+ messages in thread
From: Mark Lewis @ 2007-07-13 14:02 UTC (permalink / raw)
To: Michael Schmidt <michaelmschmidt@msn.com>; +Cc: pgsql-jdbc
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.
>
> 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.
>
> Thanks!
> Michael Schmidt
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: backup through Java
2007-07-13 00:01 backup through Java Michael Schmidt <michaelmschmidt@msn.com>
2007-07-13 14:02 ` Re: backup through Java Mark Lewis <mark.lewis@mir3.com>
@ 2007-07-13 18:02 ` Michael Schmidt <michaelmschmidt@msn.com>
0 siblings, 0 replies; 3+ messages in thread
From: Michael Schmidt @ 2007-07-13 18:02 UTC (permalink / raw)
To: Mark Lewis <mark.lewis@mir3.com>; +Cc: pgsql-jdbc
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 -----
From: Mark Lewis<mailto:mark.lewis@mir3.com>
To: Michael Schmidt<mailto:michaelmschmidt@msn.com>
Cc: PostgreSQL JDBC<mailto:pgsql-jdbc@postgresql.org>
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.
>
> 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.
>
> Thanks!
> Michael Schmidt
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2007-07-13 18:02 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-07-13 00:01 backup through Java Michael Schmidt <michaelmschmidt@msn.com>
2007-07-13 14:02 ` Mark Lewis <mark.lewis@mir3.com>
2007-07-13 18:02 ` Michael Schmidt <michaelmschmidt@msn.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox