[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/propel/util/ -> Transaction.php (sommaire)

(pas de description)

Poids: 160 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Transaction:: (5 méthodes):
  begin()
  beginOptional()
  commit()
  rollback()
  safeRollback()


Classe: Transaction  - X-Ref

Utility class to make it easier to begin, commit, and rollback transactions.

This can be used to handle cases where transaction support is optional.
The second parameter of beginOptionalTransaction() will determine with a transaction
is used or not. If a transaction is not used, the commit and rollback methods
do not have any effect. Instead it simply makes the logic easier to follow
by cutting down on the if statements based solely on whether a transaction
is needed or not.

begin($dbName)   X-Ref
Begin a transaction.  This method will fallback gracefully to
return a normal connection, if the database being accessed does
not support transactions.

param: string $dbName Name of database.
return: Connection The Connection for the transaction.

beginOptional($dbName, $useTransaction)   X-Ref
Begin a transaction.  This method will fallback gracefully to
return a normal connection, if the database being accessed does
not support transactions.

param: sring $dbName Name of database.
param: boolean $useTransaction If false, a transaction won't be used.
return: Connection The Connection for the transaction.

commit($con)   X-Ref
Commit a transaction.  This method takes care of releasing the
connection after the commit.  In databases that do not support
transactions, it only returns the connection.

param: Connection $con The Connection for the transaction.
return: void

rollback($con)   X-Ref
Roll back a transaction in databases that support transactions.
It also releases the connection. In databases that do not support
transactions, this method will log the attempt and release the
connection.

param: Connection $con The Connection for the transaction.
return: void

safeRollback($con)   X-Ref
Roll back a transaction without throwing errors if they occur.

param: Connection $con The Connection for the transaction.
return: void



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7