CaselIT opened a new issue, #4321:
URL: https://github.com/apache/arrow-adbc/issues/4321

   ### What feature or improvement would you like to see?
   
   Hi,
   
   I've noticed that rollback in the postgresql driver is hardcoded to execute 
`ROLLBACK AND CHAIN`: 
https://github.com/apache/arrow-adbc/blob/f60342350397d5355b99906af5c36cc88d4c7f9d/c/driver/postgresql/connection.cc#L1146-L1170
   
   It would be useful to have an option not to do this, and just execute a 
plain `ROLLBACK` (and `COMMIT` see below)
   
   In my use case I'm doing connection pooling and this means that every time I 
return a connection to the pool rollback is called, but this starts a new 
transaction that stays idle in the pool.
   
   Personally this seems something the driver should not do by default since 
`ROLLBACK AND CHAIN` has other impacts that may not obvious to the user ([the 
new transaction has the same characteristic of the the old 
one](https://www.postgresql.org/docs/18/sql-rollback.html#SQL-ROLLBACK-CHAIN)), 
but I think it's fine if an option is available to disable this behaviour that 
can be set then creating the connection.
   Similarly commit creates a new connection by default. It could make sense to 
connect the option also to this behaviour.
   Also maybe using `ROLLBACK; BEGIN TRANSACTIN` would be better for this 
behaviour since that does not imply carrying over the previous transaction 
options
   
   in any case I think it should be documented, since this is kinda surprising
   
   note that maybe I'm using it wrongly, but I'm basically following the recipe 
mentioned here 
https://arrow.apache.org/adbc/current/python/recipe/postgresql.html#connection-pooling-with-sqlalchemy
 that also makes no mention of this behaviour
   
   thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to