The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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) |
#2
|
|||
|
|||
![]()
From memory, the transactional things are dealt with by mysql, not php.
But MyISAM doesnt support transactional queries. |
#3
|
|||
|
|||
![]()
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] |
#4
|
|||
|
|||
![]()
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'); build_new_post(); mysql_query('ROLLBACK'); Code:
$vbulletin->database->begin_transaction(); $dm = init_datamanager(...) $dm->... $vbulletin->database->rollback_transaction(); |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|