code: def test_commit_while_async(self):
      cur = self.conn.cursor()
  
      cur.execute("begin")
      self.wait(cur)
  
      cur.execute("insert into table1 values (1)")
  
      # a commit should not work in asynchronous mode
      self.assertRaises(psycopg2.ProgrammingError, self.conn.commit)
      self.assertTrue(self.conn.isexecuting())
  
      # but a manual commit should
      self.wait(cur)
      cur.execute("commit")
      self.wait(cur)
  
      cur.execute("select * from table1")
      self.wait(cur)
      self.assertEquals(cur.fetchall()[0][0], 1)
  
      cur.execute("delete from table1")
      self.wait(cur)
  
      cur.execute("select * from table1")
      self.wait(cur)
      self.assertEquals(cur.fetchone(), None)
  
imports: import gc
  import time
  import unittest
  import warnings
  import psycopg2
  import psycopg2.errors
  from psycopg2 import extensions
  from .testutils import ConnectingTestCase, StringIO, skip_before_postgres, skip_if_crdb, crdb_version, slow
label_desc: Use image node_id 9 for calling the AsyncTests obj's underlying member method code with example usage: obj.test_commit_while_async() without return types