make double-sure that this is a transaction context, notably for LOCK TABLE;
authorwenzelm
Sun, 16 Jul 2023 19:30:10 +0200
changeset 78370 fda3f7a158b9
parent 78369 ba71ea02d965
child 78371 928e031b7c52
make double-sure that this is a transaction context, notably for LOCK TABLE;
src/Pure/General/sql.scala
--- a/src/Pure/General/sql.scala	Sun Jul 16 19:13:08 2023 +0200
+++ b/src/Pure/General/sql.scala	Sun Jul 16 19:30:10 2023 +0200
@@ -734,6 +734,10 @@
     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