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 8979755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:55:09+00:00 2026-06-15T19:55:09+00:00

The ZF1 Zend_Db reference manual has an entire section on performing transactions. The ZF2

  • 0

The ZF1 Zend_Db reference manual has an entire section on performing transactions.

The ZF2 Zend\Db reference manual lacks any documentation on transactions.

How do I perform transactions in ZF2? Example code would be helpful.

  • 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-06-15T19:55:10+00:00Added an answer on June 15, 2026 at 7:55 pm

    The missing documentation is curious.

    To find out what happened, I had to dive into the API docs for Zend\Db\Adapter.

    It looks like beginTransaction, rollback and commit are defined in Zend\Db\Adapter\Driver\ConnectionInterface. This means that they are methods callable on every single adapter connection. Unfortunately the connection itself is rather buried.

    What I’m not clear on — and can’t provide an example for at this time — is figuring out which object you actually call these methods on. In the worst case, it looks like you might want to call $adapter->getDriver()->getConnection()->beginTransaction().

    Eww.

    I’m hoping someone else with more knowledge, and a copy of ZF2 handy, will see this and provide a better option.

    Don’t forget that you can just issue BEGIN TRANSACTION/ROLLBACK/COMMIT/SET autocommit=... SQL statements yourself. This is probably OK, as it doesn’t look like Zend\Db keeps track of the transaction state.

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

Sidebar

Related Questions

is it possible to use twitter bootstap on a zend framework ( zf1 )
ZF1 had a gread search lucene implementation. is there something similar for ZF2? I
Is it possible to replace ZF1 Autoloader with ZF2 Autoloader, as it seems that
With ZF1 when i create the database connection string it works without any issue.
I was wondering if any one had any kind of success integrating a Zend
My Zend Framework 2 application has a route definition that's trying to mimic the
I am learning ZF2.0 beta . In ZF1 we can change layout on the
I am trying to setup a zf1 + doctrine mongo odm 1.0.0BETA4-DEV project. I
I use memcached, the previous environment (xampp1.73) php5.3 and zf1. No problem. I upgraded
i am trying to validate a user registration form in Zend Framework 2. More

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.