diff --git a/generator/classes/propel/engine/builder/om/php5/PHP5NestedSetPeerBuilder.php b/generator/classes/propel/engine/builder/om/php5/PHP5NestedSetPeerBuilder.php
index <HASH>..<HASH> 100644
--- a/generator/classes/propel/engine/builder/om/php5/PHP5NestedSetPeerBuilder.php
+++ b/generator/classes/propel/engine/builder/om/php5/PHP5NestedSetPeerBuilder.php
@@ -1500,6 +1500,7 @@ abstract class ".$this->getClassname()." extends ".$this->getPeerBuilder()->getC
 			$script .= "
 					}
 				}
+				\$stmt->closeCursor();
 			}
 		}
 	}
Added closeCursor() call after loop on $stmt fetching