# HG changeset patch # User wenzelm # Date 1689622527 -7200 # Node ID ee588c4b55578c3e6883c3e99131a3ec1197a4d6 # Parent 4d9b953c7026548b3c5c4c9c78948181a8234d36 more elementary transaction implementation (despite fda3f7a158b9 and 9da65bc75610); diff -r 4d9b953c7026 -r ee588c4b5557 src/Pure/General/sql.scala --- a/src/Pure/General/sql.scala Mon Jul 17 20:59:50 2023 +0200 +++ b/src/Pure/General/sql.scala Mon Jul 17 21:35:27 2023 +0200 @@ -442,13 +442,12 @@ require(connection.getAutoCommit(), "transaction already active") try { connection.setAutoCommit(false) - val savepoint = connection.setSavepoint() try { val result = body connection.commit() result } - catch { case exn: Throwable => connection.rollback(savepoint); throw exn } + catch { case exn: Throwable => connection.rollback(); throw exn } } finally { connection.setAutoCommit(true) } } @@ -749,10 +748,6 @@ override def lock_tables(tables: List[SQL.Table]): PostgreSQL.Source = if_proper(tables, "LOCK TABLE " + tables.mkString(", ") + " IN ACCESS EXCLUSIVE MODE") - override def transaction[A](body: => A): A = super.transaction { - execute_statement("START TRANSACTION") - body - } /* notifications: IPC via database server */ // see https://www.postgresql.org/docs/current/sql-notify.html