[DB] - OC_DB::rollback() seems to be missing
There is a \OCP\DB::beginTransaction()
There is a \OCP\DB::commit()
But there is no \OCP\DB::rollback() :collision: the database may be left in an unstable state, hard to recover.
https://github.com/owncloud/core/blob/master/lib/public/db.php https://github.com/owncloud/documentation/blob/2ec72ebbb28c7bd0b9f41bbf088c1ee53953eaca/developer_manual/app/app/database.rst
ownCloud 6.0.4 (stable)
php 5.4.4-14+deb7u12
MySQL 5.5.37-0+wheezy1
debian 7.6 (wheezy) 32 bits
Thanks a lot for your report! - Should be an easy job -> assigning junior label
I'm not 100% sure this is the correct fix, but I've committed a fix in my own fork to add the missing rollback method.
However, I'm not sure on the correct naming to use and whether this is the full fix or only a part fix.
Naming Confusion
There is an interface named IDBConnection [code] which uses the name rollBack (using camelCase) instead of the name rollback as it appears in other classes. However, I cannot see a relationship between the OC_DB class and the IDBConnection class, but I may just have made a mistake or missed it somewhere.
The class \OC\DB\Connection [code] extends \Doctrine\DBAL\Connection. The Doctrine docs for this class use the method name rollback (not in camelCase).
What should the correct name for the rollback method be? rollback or rollBack?
I just wanted to check whether this commit is correct and:
- uses the correct naming standards
- fully implements the missing method everywhere in all the relevant classes
before I submit a PR with half-ready code.
@MorrisJobke please could you check if my thinking in the above comment is correct?
@DeepDiver1975 Can you check that? I'm confused by all those static classes and inheritance stuff. Also it seems that the interface (IDBConnection) is partly covered by our code and partly covered by doctrine code. Is this correct?
@danbartram please submit your change as pull request - we will review the change then. from the first look it seems to be the way to go. THX
@DeepDiver1975 Will do, just wanted to check if there was an obvious missed function declaration. I've submitted a PR now, we'll see how it goes. Thank you (and @MorrisJobke too)!
fixed in #11767