#485 √ works-for-me
arek

begin, commit, rollback doesn't work on mssql

Reported by arek | March 19th, 2010 @ 10:58 AM | in 1.2.6

On mssql datasource (Microsoft SQL Server) working with transactions (call begin, commit or rollback as model method) returns error.

There is more information in attachment - call stack.

It was called under cakeshell but I don't think that it matters.

CakePHP version 1.2.6

Comments and changes to this ticket

  • Mark Story

    Mark Story March 19th, 2010 @ 12:00 PM

    • → Milestone set to 1.2.6
    • → Tag set to dbomssql, defect

    The methods are not on the model. They are on the dbo objects, do you happen to know the correct transaction commands on MsSQL if BEGIN TRANSACTION, COMMIT and ROLLBACK are incorrect?

  • arek

    arek March 19th, 2010 @ 01:42 PM

    Yes I know these commands.

    But maybe you right. I don't remember now when I found that transaction commands should be called on model object. I think it started to be uncommented methods of model object:) Even you coders found that as cen be seen on documentation to 1.3 version http://book.cakephp.org/ja/revisions/view/17574/Model-Databases-and....

    DboSource::query() now throws warnings for un-handled model methods, instead of trying to run them as queries. This means, people starting transactions improperly via the $this->Model->begin() syntax will need to update their code so that it accesses the model's DataSource object directly.

    I have checked that $this->Model->getDataSource()->begin($this->Model) is working fine. If you confirm that this correct method to work with transactions is operating on DataSource object You can close this ticket.

  • Mark Story

    Mark Story March 20th, 2010 @ 09:55 AM

    • → State changed from “new” to “works-for-me”

    $this->Model->getDataSource()->begin($this->Model) is far more correct than calling the methods on the model :)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Source available from github

Repository is at http://github.com/cakephp/cakephp

Creating a bug report

When creating a bug report, please include as much relevant information as possible. Please include code to reproduce the issue. Or even better, make a unit test. Either change an existing test or add a new test to show that the expected behavior is not occuring.

People watching this ticket

Attachments