Menu

#246 Zeos has problem for PostgreSQL disconnection inside transaction

7.3-alfa
closed
nobody
None
2018-05-16
2018-05-16
maciej-izak
No

Zeos has problem for PostgreSQL disconnection (or when DB service is stopped) inside transaction. When this happens connection can't be connected/reconnected again in proper way (many internal errors). Patch attached.

1 Attachments

Discussion

  • Luca Olivetti

    Luca Olivetti - 2018-05-16

    Investigating the same problem I found a different solution: in the procedure TZPostgreSQLConnection.DeallocatePrepareStatements, in the call to CheckPostgreSQLError change the parameter lcExecute to lcUnprepStmt.
    This way it won't raise an error in case the connection is dropped. Since I'm not familiar with the code I cannot say if it has any adverse side effect.

     
  • EgonHugeist

    EgonHugeist - 2018-05-16

    Hi Maciej,

    patches are welcome!
    patch applied R4577 (testing-7.3)

    @Luca,
    nice too! Patch done R4579 (testing-7.3)

    Note i'd change most of the code according the "deallocate" stuff yesterday. The original code was made because of PostrgreSQL oddly broken transaction state. Current code does check the error-code : "25P02" -> current_transaction_is_aborted on trying to deallocate the stmt. If the error code is given i add the planname to jan's trashbin-chain.

    Please Close if ok. Cheers, Michael

     
  • maciej-izak

    maciej-izak - 2018-05-16
    • status: open --> closed
     

Log in to post a comment.