![]() |
Unit Testing & Transactions
I'd like to use transactions to add unit testing to my vB mods & code. That is, I'd like to tell vB "Start a transaction. Now, use the DM API to do things. Now roll that transaction back" So the tests haven't disturbed anything.
Is there anyway to do this? How? (PHP4/MySQL4, but could switch to PHP5 if necessary) |
From memory, the transactional things are dealt with by mysql, not php.
But MyISAM doesnt support transactional queries. |
Have a look at the following URL's:
http://dev.mysql.com/books/mysqlpres...rial/ch10.html http://dev.mysql.com/doc/mysql/en/an...rent-apis.html Like Merk already say, you can not use this with MyISAM tables. For InnoDB it is basically: Start transaction: [sql]BEGIN TRANSACTION;[/sql] Then end the transaction with one of the following: [sql]COMMIT;[/sql] or: [sql]ROLLBACK;[/sql] |
Sorry for not being more clear. I know how to do transactions in SQL. My question is, could I somehow wrap vB's actions in transactions. Something like:
Code:
mysql_query('BEGIN TRANSACTION'); Code:
$vbulletin->database->begin_transaction(); |
All times are GMT. The time now is 07:31 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|