Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5940257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:56:36+00:00 2026-05-22T15:56:36+00:00

I have to perform a group of SQL operations that either survive together or

  • 0

I have to perform a group of SQL operations that either survive together or die together.
So that if any part of my statement/s fail, the entire process is rolled back to the beginning as if the transaction never took place.

without zend I would do:

$conn->query('BEGIN');
$conn->query($myQuery);
//rollback if anything went wrong
$conn->query('COMMIT'); 

In Zend I created the Db connection in my bootstrap:

    protected function _initDb()
{
    $config=Zend_registry::get('config');
    $db = Zend_Db::factory($config->resources->db->adapter, $config->resources->db->params);  
    //set default adapter         
    Zend_Db_Table_Abstract::setDefaultAdapter($db); 
    Zend_Registry::set("db", $db);  
}

And interactions with Db are made by models classes (extending Zend_Db_Table_abstract)

class Platform extends Zend_Db_Table_Abstract
{
 public function insertPlatform($x)
 {
  $this->insert($x);
 }
}
class Game extends Zend_Db_Table_Abstract
{
 public function insertGame($x)
 {
  $this->insert($x);
 }
}

How could I achieve the same (survive together or die together)in Zend?

thanks

Luca

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:56:37+00:00Added an answer on May 22, 2026 at 3:56 pm

    Zend_Db wraps the transaction functionality too. So there is nothing different in using it with or without ZF.

    You find ZF transactions explained in the Adapter Section of the Zend_Db Manual. Look for the paragraph ‘Controlling Database Transactions’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SQL statement that grabs the grades of different activity types (Homework,
I have to perform a SQL query to get the top 10 albums according
I found that I have to perform a swap in python and I write
I have a forum. I want to perform an SQL query so I can
I have one Linq to SQL query that simply joins three tables and then
I have the following SQL query that performs a subquery and joins two tables
I have to perform the following SQL query: select answer_nbr, count(distinct user_nbr) from tpoll_answer
I have to perform async execution, and i have wrote the below code var
I have to perform mapping between ISO 3166-1 alpha-3 and IOC country codes. It
I have to perform a large number of replacements in some documents, and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.