public function onFinish(MvcEvent $event)
    {
        $connection = $this->getObjectManager()->getConnection();
        
        if ($connection->isTransactionActive()) {
            $connection->commit();
        }
    }