[Vtigercrm-commits] [vtiger-commits] r9145 - /vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Aug 28 14:32:16 EDT 2006


Author: richie
Date: Mon Aug 28 12:32:07 2006
New Revision: 9145

Log:
Support for PostGres DB done

Modified:
    vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php

Modified: vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php
==============================================================================
--- vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php (original)
+++ vtigercrm/trunk/adodb/drivers/adodb-postgres64.inc.php Mon Aug 28 12:32:07 2006
@@ -169,13 +169,25 @@
    }
    
 	
-		// returns true/false
-	function BeginTrans()
-	{
-		if ($this->transOff) return true;
-		$this->transCnt += 1;
-		return @pg_Exec($this->_connectionID, "begin ".$this->_transmode);
-	}
+	function SetTransactionMode( $transaction_mode ) 
+ 	{
+ 		if (empty($transaction_mode)) {
+ 			$transaction_mode = 'ISOLATION LEVEL SERIALIZABLE';
+ 		}
+ 		if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode;
+ 		$this->_transmode  = $transaction_mode;
+ 		return( @pg_Exec($this->_connectionID, "SET SESSION TRANSACTION ".$transaction_mode));
+ 	}
+ 
+  	function BeginTrans()
+  	{
+  		if ($this->transOff) return true;
+  		$this->transCnt += 1;
+ 		if( $this->SetTransactionMode($this->_transmode))
+ 		    return @pg_Exec($this->_connectionID, "begin");
+ 		else
+ 		    return(0);
+  	}
 	
 	function RowLock($tables,$where,$flds='1 as ignore') 
 	{
@@ -1051,4 +1063,4 @@
 	}
 
 }
-?>
+?>





More information about the vtigercrm-commits mailing list