Changeset 7486
- Timestamp:
- 02/14/08 17:20:15 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfMDB2RestPlugin/trunk/lib/MDB2RestClient.class.php
r7155 r7486 115 115 116 116 $this->_logToSymfony('Unserializing and returing...'); 117 $this->_logToSymfony($results); 118 117 119 return unserialize($results); 118 120 } … … 232 234 if (isset($results['error'])) { 233 235 throw new Exception($results['error']); 236 } elseif (isset($results['transaction_errors'])) { 237 throw new Exception(print_r($results['transaction_errors'])); 234 238 } else { 235 239 return $results; plugins/sfMDB2RestPlugin/trunk/lib/MDB2RestServer.class.php
r5600 r7486 117 117 $results = array('error' => $e->getMessage()); 118 118 } 119 119 120 120 121 return $results; 121 122 } … … 129 130 { 130 131 $results = array(); 132 133 if ($this->mdb2->supports('transactions')) 134 { 135 $this->mdb2->beginTransaction(); 136 } 137 131 138 foreach ($arguments as $request) { 132 139 $results[] = $this->executeRequest($request); 133 140 } 134 141 142 if ($this->mdb2->supports('transactions') && $this->mdb2->in_transaction) 143 { 144 $errors = array(); 145 $i = 0; 146 foreach($results as $r) 147 { 148 if(isset($r['error'])) 149 { 150 151 $errors[$i] = $r['error']; 152 } 153 $i++; 154 } 155 if(sizeof($errors) > 0) 156 { 157 $results['transaction_errors'] = $errors; 158 $this->mdb2->rollback(); 159 } 160 else 161 { 162 $this->mdb2->commit(); 163 } 164 } 165 135 166 return $results; 136 167 }