@@ -651,21 +651,6 @@ class Transaction(Element):
651651 >>> with db.xact():
652652 ... with db.xact():
653653 ... ...
654-
655- [DEPRECATED]
656-
657- Or, in cases where two-phase commit is desired:
658-
659- >>> with db.xact(gid = 'gid') as gxact:
660- ... with gxact:
661- ... # phase 1 block
662- ... ...
663- >>> # fully committed at this point
664-
665- Considering that transactions decide what's saved and what's not saved, it is
666- important that they are used properly. In most situations, when an action is
667- performed where state of the transaction is unexpected, an exception should
668- occur.
669654 """
670655 _e_label = 'XACT'
671656 _e_factors = ('database' ,)
@@ -694,20 +679,6 @@ def isolation(self) -> (None, str):
694679 the START TRANSACTION statement.
695680 """
696681
697- @propertydoc
698- @abstractproperty
699- def gid (self ) -> (None , str ):
700- """
701- [DEPRECATED]
702-
703- The global identifier of the transaction block:
704-
705- PREPARE TRANSACTION <gid>;
706-
707- The `gid` property is a string that indicates that the block is a prepared
708- transaction.
709- """
710-
711682 @abstractmethod
712683 def start (self ) -> None :
713684 """
@@ -726,7 +697,7 @@ def start(self) -> None:
726697 `self.mode` specifies the mode of the transaction. Normally, ``READ
727698 ONLY`` or ``READ WRITE``.
728699
729- If the transaction is open--started or prepared , do nothing.
700+ If the transaction is already open , do nothing.
730701
731702 If the transaction has been committed or aborted, raise an
732703 `postgresql.exceptions.OperationError`.
@@ -738,9 +709,6 @@ def commit(self) -> None:
738709 """
739710 Commit the transaction.
740711
741- If the transaction is configured with a `gid` issue a COMMIT PREPARED
742- statement with the configured `gid`.
743-
744712 If the transaction is a block, issue a COMMIT statement.
745713
746714 If the transaction was started inside a transaction block, it should be
@@ -759,46 +727,9 @@ def rollback(self) -> None:
759727 If the transaction is a transaction block, issue an ABORT.
760728
761729 If the transaction has already been aborted, do nothing.
762-
763- [DEPRECATED]
764- If the transaction is configured with a `gid` *and* has been prepared, issue
765- a ROLLBACK PREPARE statement with the configured `gid`.
766730 """
767731 abort = rollback
768732
769- @abstractmethod
770- def recover (self ) -> None :
771- """
772- [DEPRECATED]
773-
774- If the transaction is assigned a `gid`, recover may be used to identify
775- the transaction as prepared and ready for committing or aborting.
776-
777- This method is used in recovery procedures where a prepared transaction
778- needs to be committed or rolled back.
779-
780- If no prepared transaction with the configured `gid` exists, a
781- `postgresql.exceptions.UndefinedObjectError` must be raised.
782- [This is consistent with the error raised by ROLLBACK/COMMIT PREPARED]
783-
784- Once this method has been ran, it should identify the transaction as being
785- prepared so that subsequent invocations to `commit` or `rollback` should
786- cause the appropriate ROLLBACK PREPARED or COMMIT PREPARED statements to
787- be executed.
788- """
789-
790- @abstractmethod
791- def prepare (self ) -> None :
792- """
793- [DEPRECATED]
794-
795- Explicitly prepare the transaction with the configured `gid` by issuing a
796- PREPARE TRANSACTION statement with the configured `gid`.
797- This *must* be called for the first phase of the commit.
798-
799- If the transaction is already prepared, do nothing.
800- """
801-
802733 @abstractmethod
803734 def __enter__ (self ):
804735 """
@@ -822,9 +753,7 @@ def __exit__(self, typ, obj, tb):
822753 unavailable, the `rollback` method should cause a
823754 `postgresql.exceptions.ConnectionDoesNotExistError` exception to occur.
824755
825- Otherwise, run the transaction's `commit` method. If the commit fails,
826- a `gid` is configured, and the connection is still available, run the
827- transaction's `rollback` method.
756+ Otherwise, run the transaction's `commit` method.
828757
829758 When the `commit` is ultimately unsuccessful or not ran at all, the purpose
830759 of __exit__ is to resolve the error state of the database iff the
@@ -955,7 +884,6 @@ def client_port(self) -> (int, None):
955884 @propertydoc
956885 @abstractproperty
957886 def xact (self ,
958- gid : "global identifier to configure" = None ,
959887 isolation : "ISOLATION LEVEL to use with the transaction" = None ,
960888 mode : "Mode of the transaction, READ ONLY or READ WRITE" = None ,
961889 ) -> Transaction :
0 commit comments