pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedProposed patch for showing originating query on error
7+ messages / 2 participants
[nested] [flat]
* Proposed patch for showing originating query on error
@ 2005-07-28 14:00 Dave Cramer <pg@fastcrypt.com>
0 siblings, 2 replies; 7+ messages in thread
From: Dave Cramer @ 2005-07-28 14:00 UTC (permalink / raw)
To: pgsql-jdbc
This just adds an exception to the existing backend exception showing
the originating query.
Given that the backend doesn't show us this information, a few people
have asked for it.
Dave
*** 426,437 ****
--- 432,451 ----
StatementResultHandler handler = new StatementResultHandler
();
result = null;
+ try
+ {
connection.getQueryExecutor().execute(queryToExecute,
queryParameters,
handler,
maxrows,
fetchSize,
flags);
+ }
+ catch( SQLException ex )
+ {
+ handler.handleError(new PSQLException(GT.tr("Original
Query -->") + queryToExecute.toString(queryParameters),
PSQLState.UNKNOWN_ST
ATE));
+ throw ex;
+ }
result = firstUnclosedResult = handler.getResults();
}
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Proposed patch for showing originating query on error
@ 2005-07-28 14:22 Oliver Jowett <oliver@opencloud.com>
parent: Dave Cramer <pg@fastcrypt.com>
1 sibling, 1 reply; 7+ messages in thread
From: Oliver Jowett @ 2005-07-28 14:22 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Dave Cramer wrote:
> *** 426,437 ****
> --- 432,451 ----
Uh, what file is this a patch to?
-O
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Proposed patch for showing originating query on error
@ 2005-07-28 14:32 Dave Cramer <pg@fastcrypt.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 7+ messages in thread
From: Dave Cramer @ 2005-07-28 14:32 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc
AbstractJdbc2Statement.java
On 28-Jul-05, at 10:22 AM, Oliver Jowett wrote:
> Dave Cramer wrote:
>
>
>> *** 426,437 ****
>> --- 432,451 ----
>>
>
> Uh, what file is this a patch to?
>
> -O
>
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Proposed patch for showing originating query on error
@ 2005-07-28 14:46 Oliver Jowett <oliver@opencloud.com>
parent: Dave Cramer <pg@fastcrypt.com>
1 sibling, 1 reply; 7+ messages in thread
From: Oliver Jowett @ 2005-07-28 14:46 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Dave Cramer wrote:
> This just adds an exception to the existing backend exception showing
> the originating query.
I think the basic idea is ok, but..
- this should be on the original exception, not on a chained synthetic
exception
- doing it only in execute() seems incomplete, there are other query
execution paths, perhaps this logic belongs somewhere in the query executor?
- ideally it should be configurable (hook it into whatever came out of
Kris' suggestions about including more info in server-generated
exception, perhaps?)
-O
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Proposed patch for showing originating query on error
@ 2005-07-28 14:55 Dave Cramer <pg@fastcrypt.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 7+ messages in thread
From: Dave Cramer @ 2005-07-28 14:55 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc
On 28-Jul-05, at 10:46 AM, Oliver Jowett wrote:
> Dave Cramer wrote:
>
>> This just adds an exception to the existing backend exception showing
>> the originating query.
>>
>
> I think the basic idea is ok, but..
>
> - this should be on the original exception, not on a chained synthetic
> exception
Yeah, that would be cleaner.
> - doing it only in execute() seems incomplete, there are other query
> execution paths, perhaps this logic belongs somewhere in the query
> executor?
There are even more paths there to hook into. Putting it in
AbstractJdbc2Statement minimizes
the number of places it would need to be added to. QueryExecutor has
a few Implementations ...
> - ideally it should be configurable (hook it into whatever came out of
> Kris' suggestions about including more info in server-generated
> exception, perhaps?)
Well, lets get it working first before we make it configurable.
>
> -O
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Proposed patch for showing originating query on error
@ 2005-07-28 15:06 Oliver Jowett <oliver@opencloud.com>
parent: Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 7+ messages in thread
From: Oliver Jowett @ 2005-07-28 15:06 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Dave Cramer wrote:
> There are even more paths there to hook into. Putting it in
> AbstractJdbc2Statement minimizes
> the number of places it would need to be added to. QueryExecutor has a
> few Implementations ...
Well, do you have a better suggestion that catches all paths?
>> - ideally it should be configurable (hook it into whatever came out of
>> Kris' suggestions about including more info in server-generated
>> exception, perhaps?)
>
> Well, lets get it working first before we make it configurable.
sigh :( let's get it right before we commit it at all.. in practise it
seems "we'll fix this later" means "we won't fix it"
-O
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Proposed patch for showing originating query on error
@ 2005-07-28 15:15 Dave Cramer <pg@fastcrypt.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 7+ messages in thread
From: Dave Cramer @ 2005-07-28 15:15 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc
On 28-Jul-05, at 11:06 AM, Oliver Jowett wrote:
> Dave Cramer wrote:
>
>
>> There are even more paths there to hook into. Putting it in
>> AbstractJdbc2Statement minimizes
>> the number of places it would need to be added to. QueryExecutor
>> has a
>> few Implementations ...
>>
>
> Well, do you have a better suggestion that catches all paths?
I'll give it some serious attention later, I hacked it in to your
code for someone, just wanted to get it into the discussion.
>
>
>>> - ideally it should be configurable (hook it into whatever came
>>> out of
>>> Kris' suggestions about including more info in server-generated
>>> exception, perhaps?)
>>>
>>
>> Well, lets get it working first before we make it configurable.
>>
>
> sigh :( let's get it right before we commit it at all.. in practise it
> seems "we'll fix this later" means "we won't fix it"
Agreed.
>
> -O
>
>
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2005-07-28 15:15 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-28 14:00 Proposed patch for showing originating query on error Dave Cramer <pg@fastcrypt.com>
2005-07-28 14:22 ` Oliver Jowett <oliver@opencloud.com>
2005-07-28 14:32 ` Dave Cramer <pg@fastcrypt.com>
2005-07-28 14:46 ` Oliver Jowett <oliver@opencloud.com>
2005-07-28 14:55 ` Dave Cramer <pg@fastcrypt.com>
2005-07-28 15:06 ` Oliver Jowett <oliver@opencloud.com>
2005-07-28 15:15 ` Dave Cramer <pg@fastcrypt.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