[odb-users] ERROR: prepared statement already exists

Boris Kolpackov boris at codesynthesis.com
Mon Oct 11 12:49:47 EDT 2021

Andrea Ranfone <a.ranfone at gyala.it> writes:

> I'm using odb version 2.4.0 with PostgreSQL 12 database and I stepped on a
> strange situation when retrying a transaction after a deadlock exception.
> When a recoverable exception occurs and the transaction is rolled back, it
> seems that the deallocation of the prepared statement created in the failed
> transaction fails with the following error:
> ERROR: current transaction is aborted, commands ignored until end of
> transaction block
> STATEMENT: deallocate "query_class_name"
> So when I try to run a new transaction to retry the failed transaction I get
> the following error:
> ERROR: prepared statement "query_class_name" already exists

I believe this is already fixed for the 2.5.0 release, see:



You can try it using the latest pre-release version:


More information about the odb-users mailing list