pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
rollback ignored until end of transaction block
11+ messages / 4 participants
[nested] [flat]

* rollback ignored until end of transaction block
@ 2005-11-22 20:51 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2005-11-22 20:55 ` Re: rollback ignored until end of transaction block Scott Marlowe <smarlowe@g2switchworks.com>
  2005-11-22 21:53 ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  0 siblings, 2 replies; 11+ messages in thread

From: Kevin Grittner @ 2005-11-22 20:51 UTC (permalink / raw)
  To: pgsql-jdbc

Is there any context where this would make sense?:

org.postgresql.util.PSQLException: ERROR: current transaction is
aborted, commands ignored until end of transaction block
	at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
	at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
	at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
	at
org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:617)
	at
org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:654)
	<application code>





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
  2005-11-22 20:51 rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2005-11-22 20:55 ` Scott Marlowe <smarlowe@g2switchworks.com>
  1 sibling, 0 replies; 11+ messages in thread

From: Scott Marlowe @ 2005-11-22 20:55 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc

On Tue, 2005-11-22 at 14:51, Kevin Grittner wrote:
> Is there any context where this would make sense?:
> 
> org.postgresql.util.PSQLException: ERROR: current transaction is
> aborted, commands ignored until end of transaction block
> 	at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
> 	at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
> 	at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> 	at
> org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:617)
> 	at
> org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:654)
> 	<application code>

There was an error earlier in your transaction.  This error is simply
telling you that nothing you do until you close this transaction will be
accepted and acted upon.  You need to get the earlier error that caused
the transaction to abort.



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
  2005-11-22 20:51 rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2005-11-22 21:53 ` Oliver Jowett <oliver@opencloud.com>
  2005-11-22 22:16   ` Re: rollback ignored until end of transaction block Kris Jurka <books@ejurka.com>
  1 sibling, 1 reply; 11+ messages in thread

From: Oliver Jowett @ 2005-11-22 21:53 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc

Kevin Grittner wrote:
> Is there any context where this would make sense?:
> 
> org.postgresql.util.PSQLException: ERROR: current transaction is
> aborted, commands ignored until end of transaction block
> 	at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
> 	at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
> 	at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> 	at
> org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:617)
> 	at
> org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:654)

Huh, that *is* weird. rollback() should do nothing but execute ROLLBACK, 
which shouldn't trigger that error.. How did you get it into that state? 
Can you run with loglevel=2 and see what the trace says? What driver 
version?

-O



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
  2005-11-22 20:51 rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2005-11-22 21:53 ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
@ 2005-11-22 22:16   ` Kris Jurka <books@ejurka.com>
  2005-11-22 22:44     ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Kris Jurka @ 2005-11-22 22:16 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-jdbc



On Wed, 23 Nov 2005, Oliver Jowett wrote:

> Kevin Grittner wrote:
>> Is there any context where this would make sense?:
>> 
>> org.postgresql.util.PSQLException: ERROR: current transaction is
>> aborted, commands ignored until end of transaction block
>
> Huh, that *is* weird. rollback() should do nothing but execute ROLLBACK, 
> which shouldn't trigger that error.. How did you get it into that state? Can 
> you run with loglevel=2 and see what the trace says? What driver version?
>

This thread might be relevent.  Checking might have been tightened up too 
much?

http://archives.postgresql.org/pgsql-bugs/2005-11/msg00094.php

Kris Jurka



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
  2005-11-22 20:51 rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2005-11-22 21:53 ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  2005-11-22 22:16   ` Re: rollback ignored until end of transaction block Kris Jurka <books@ejurka.com>
@ 2005-11-22 22:44     ` Oliver Jowett <oliver@opencloud.com>
  2005-11-22 22:57       ` Re: rollback ignored until end of transaction block Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Oliver Jowett @ 2005-11-22 22:44 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-jdbc

Kris Jurka wrote:
> 
> 
> On Wed, 23 Nov 2005, Oliver Jowett wrote:
> 
>> Kevin Grittner wrote:
>>
>>> Is there any context where this would make sense?:
>>>
>>> org.postgresql.util.PSQLException: ERROR: current transaction is
>>> aborted, commands ignored until end of transaction block
>>
>>
>> Huh, that *is* weird. rollback() should do nothing but execute 
>> ROLLBACK, which shouldn't trigger that error.. How did you get it into 
>> that state? Can you run with loglevel=2 and see what the trace says? 
>> What driver version?
>>
> 
> This thread might be relevent.  Checking might have been tightened up 
> too much?
> 
> http://archives.postgresql.org/pgsql-bugs/2005-11/msg00094.php

I just tried against a server built from HEAD and couldn't reproduce the 
problem any of the obvious ways.. Think we will need a testcase here.

-O



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
  2005-11-22 20:51 rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2005-11-22 21:53 ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  2005-11-22 22:16   ` Re: rollback ignored until end of transaction block Kris Jurka <books@ejurka.com>
  2005-11-22 22:44     ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
@ 2005-11-22 22:57       ` Kris Jurka <books@ejurka.com>
  2005-11-22 23:22         ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Kris Jurka @ 2005-11-22 22:57 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-jdbc



On Wed, 23 Nov 2005, Oliver Jowett wrote:

> I just tried against a server built from HEAD and couldn't reproduce the 
> problem any of the obvious ways.. Think we will need a testcase here.
>

Another idea that occurred to me that I don't have time to test is that 
processDeadParsedQueries or processDeadPortals doesn't like getting run in 
a stalled transaction.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
  2005-11-22 20:51 rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2005-11-22 21:53 ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  2005-11-22 22:16   ` Re: rollback ignored until end of transaction block Kris Jurka <books@ejurka.com>
  2005-11-22 22:44     ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  2005-11-22 22:57       ` Re: rollback ignored until end of transaction block Kris Jurka <books@ejurka.com>
@ 2005-11-22 23:22         ` Oliver Jowett <oliver@opencloud.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Oliver Jowett @ 2005-11-22 23:22 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-jdbc

Kris Jurka wrote:
> 
> 
> On Wed, 23 Nov 2005, Oliver Jowett wrote:
> 
>> I just tried against a server built from HEAD and couldn't reproduce 
>> the problem any of the obvious ways.. Think we will need a testcase here.
>>
> 
> Another idea that occurred to me that I don't have time to test is that 
> processDeadParsedQueries or processDeadPortals doesn't like getting run 
> in a stalled transaction.

No errors against CVS HEAD with the CloseStatement/ClosePortal messages 
being sent after an error, just before the ROLLBACK:

[...]
  <=BE ReadyForQuery(E)
caught expected exception
closing query: select * from pg_proc
simple execute, 
handler=org.postgresql.jdbc2.AbstractJdbc2Connection$TransactionCommandHandler@6443226, 
maxRows=0, fetchSize=0, flags=22
  FE=> CloseStatement(S_11)
  FE=> ClosePortal(C_12)
  FE=> Bind(stmt=S_4,portal=null)
  FE=> Execute(portal=null,limit=1)
  FE=> Sync
  <=BE CloseComplete
  <=BE CloseComplete
  <=BE BindComplete [null]
  <=BE CommandStatus(ROLLBACK)
  <=BE ReadyForQuery(I)
rollback was ok

-O



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
@ 2005-11-22 22:37 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 11+ messages in thread

From: Kevin Grittner @ 2005-11-22 22:37 UTC (permalink / raw)
  To: oliver@opencloud.com; +Cc: pgsql-jdbc

The driver is the download of this file:

postgresql-8.1-404.jdbc3.jar

(We didn't do our own build on this.)

The logging from our app isn't giving anything beyond this exception
and stack trace.  We're running hundreds of thousands of transactions
per day in, with a pattern of:

(1)  Try a number of separate insert/update/delete operations in a
single database transaction.  Deletes and updates are done through
updateable result sets.  Inserts are done through prepared statements.

(2)  If an exception is thrown, cancel the statement, close the result
set (if open), close the statement, and retry in "cautious mode".  While
in cautious mode, updates of nonexistant rows become inserts, inserts
of duplicate rows become updates, oversized strings are truncated,
etc., and a commit is done of each insert/update/delete.

During a window of time I'm looking at, we processed about 50,000
of the high level transactions in about 90 minutes.  We had three of
these rollback problems.  Nothing showed in the postmaster log at the
time of these exceptions.

If I were to run with loglevel=2 with this load for an hour or two, how
big do you think the log file would get?

-Kevin


>>> Oliver Jowett <oliver@opencloud.com>  >>>
Kevin Grittner wrote:
> Is there any context where this would make sense?:
> 
> org.postgresql.util.PSQLException: ERROR: current transaction is
> aborted, commands ignored until end of transaction block
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:617)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:654)

Huh, that *is* weird. rollback() should do nothing but execute ROLLBACK,

which shouldn't trigger that error.. How did you get it into that state?

Can you run with loglevel=2 and see what the trace says? What driver 
version?

-O




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
@ 2005-11-22 22:48 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 11+ messages in thread

From: Kevin Grittner @ 2005-11-22 22:48 UTC (permalink / raw)
  To: books@ejurka.com; oliver@opencloud.com; +Cc: pgsql-jdbc

That may be hard to do.  I'll modify the code to log as much as
possible when the rollback fails -- in hopes of finding a clue.

Thanks for taking a look.

-Kevin


>>> Oliver Jowett <oliver@opencloud.com>  >>>

I just tried against a server built from HEAD and couldn't reproduce the

problem any of the obvious ways.. Think we will need a testcase here.

-O




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
@ 2005-11-23 21:30 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2005-11-23 22:35 ` Re: rollback ignored until end of transaction block Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Kevin Grittner @ 2005-11-23 21:30 UTC (permalink / raw)
  To: oliver@opencloud.com; +Cc: pgsql-jdbc

I haven't seen any of these today.  Ran part of the day with loglevel=2
and part without.  I'll keep trying.

We have fixed a couple underlying exceptions which might have set
up the conditions for this.  Is it worth intentionally regressing those
in
my application code to try to track this down if it doesn't otherwise
manifest?  It is disconcerting to be told that a rollback won't be
accepted until the end of the transaction block.   :-(

-Kevin


>>> Oliver Jowett <oliver@opencloud.com>  >>>
Kevin Grittner wrote:
> Is there any context where this would make sense?:
> 
> org.postgresql.util.PSQLException: ERROR: current transaction is
> aborted, commands ignored until end of transaction block
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
> 	at
>
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:617)
> 	at
>
org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:654)

Huh, that *is* weird. rollback() should do nothing but execute ROLLBACK,

which shouldn't trigger that error.. How did you get it into that state?

Can you run with loglevel=2 and see what the trace says? What driver 
version?

-O




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: rollback ignored until end of transaction block
  2005-11-23 21:30 Re: rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2005-11-23 22:35 ` Oliver Jowett <oliver@opencloud.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Oliver Jowett @ 2005-11-23 22:35 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc

Kevin Grittner wrote:
> I haven't seen any of these today.  Ran part of the day with loglevel=2
> and part without.  I'll keep trying.
> 
> We have fixed a couple underlying exceptions which might have set
> up the conditions for this.  Is it worth intentionally regressing those
> in
> my application code to try to track this down if it doesn't otherwise
> manifest?  It is disconcerting to be told that a rollback won't be
> accepted until the end of the transaction block.   :-(

Well, it certainly shouldn't happen, but I can't reproduce it here so 
it's pretty much in your hands..

If it does happen again then hopefully loglevel=2 output will be 
sufficient to work out what's going on.

-O



^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2005-11-23 22:35 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-22 20:51 rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-11-22 20:55 ` Scott Marlowe <smarlowe@g2switchworks.com>
2005-11-22 21:53 ` Oliver Jowett <oliver@opencloud.com>
2005-11-22 22:16   ` Kris Jurka <books@ejurka.com>
2005-11-22 22:44     ` Oliver Jowett <oliver@opencloud.com>
2005-11-22 22:57       ` Kris Jurka <books@ejurka.com>
2005-11-22 23:22         ` Oliver Jowett <oliver@opencloud.com>
2005-11-22 22:37 Re: rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-11-22 22:48 Re: rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-11-23 21:30 Re: rollback ignored until end of transaction block Kevin Grittner <Kevin.Grittner@wicourts.gov>
2005-11-23 22:35 ` Oliver Jowett <oliver@opencloud.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