ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:settransactionmode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
reference:settransactionmode [2015/08/07 04:32] – created mnewnhamv5:reference:connection:settransactionmode [2018/06/11 10:23] (current) – [Usage] function names starting with lowercase (#426) dregad
Line 2: Line 2:
 ~~NOTOC~~ ~~NOTOC~~
 <WRAP right box> <WRAP right box>
 +== See Also ==
 +[[v5:dictionary:metatransaction|metaTransaction()]]
 +
 == Syntax == == Syntax ==
   void setTransactionMode(   void setTransactionMode(
Line 9: Line 12:
 ===== Description =====       ===== Description =====      
  
-SetTransactionMode allows you to pass in the transaction mode to use for all subsequent transactions. Note: if you have persistent connections and using mssql or mysql, you might have to explicitly reset your transaction mode at the beginning of each page request. This is only supported in postgresql, mssql, mysql with InnoDB and oci8 currently. For example: +SetTransactionMode allows you to pass in the transaction mode to use for all subsequent transactions.  
 + 
 +Note: if you have persistent connections and using mssql or mysql, you might have to explicitly reset your transaction mode at the beginning of each page request.  
 + 
 +This is only supported in postgresql, mssql, mysql with InnoDB and oci8 currently.
  
 ===== Usage ===== ===== Usage =====
 <code php>  <code php> 
- +/* 
-$db->SetTransactionMode("SERIALIZABLE"); +* Set the mode 
-$8db->BeginTrans(); +*/ 
-$db->Execute(...); $db->Execute(...); +$db->setTransactionMode('serializable'); 
-$db->CommitTrans();+$db->beginTrans(); 
 +$db->execute(...); $db->execute(...); 
 +$db->commitTrans();
    
-$db->SetTransactionMode(""); // restore to default +/* 
-$db->StartTrans(); +* restore to default 
-$db->Execute(...); $db->Execute(...); +*/ 
-$db->CompleteTrans();+$db->setTransactionMode("");  
 +$db->startTrans(); 
 +$db->execute(...); 
 +$db->execute(...); 
 +$db->completeTrans(); 
 </code> </code>
 Supported values to pass in: Supported values to pass in:
v5/reference/connection/settransactionmode.txt · Last modified: 2018/06/11 10:23 by dregad