Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-23-2008, 11:53 AM
Junior Member
 
Join Date: Apr 2008
Posts: 7
Default Trying to catch Zend_DB Exceptions not always working

Hello,

I have a simple piece of code which I have broken by using the wrong field name to test catching an exception and it does not always catch the exception.

If I keep hitting F5 (refreshing) it catches the exception about 1 in 5.

This is the method

PHP Code:
private function updatePage($title$content$theID)
    {
          
        
        
$data = array(
            
'Title11'      => $title,
            
'Content'      => $content
        
);
        
        
$where[] = "theID = '".$theID."'";
        
        
$this->db->beginTransaction();
        try
        {
          
$this->db>update('MainContent'$data$where);
                    
          
$this->db->commit();
        }
        catch  (
Exception $e)
        {
                    
            
$this->db->rollBack();
            echo 
$e->getMessage().'scott';
            exit;
                
        }
    } 
Any help would be appreciated. I have not quite mastered this throw and catch yet.

Thanks

Madmaxious
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:55 AM.