Transactions in Drupal 7
Transaction is a sequence of consecutive activities even with the symptom coffer, which contains a reasonable shaving as regards work with information. The Completion can be fulfilled both wholly and successfully, while maintaining information completeness and happenning separate from the transactions which may be fulfilled simultaneously; or cannot be carried out at all. In this casing-in it shouldn't bring about any variations. Since the 7th variant, drupal provides a possibility to sustain transactions comprising those data bases which do not bear them. Just the same twentieth-century case you try against do two transactions together it may entangle the process of their implementation. In this case their conduct will hang on the kind in relation to database lost to. The like problem occurs with inserting in C++. In case the telegraphy has blocked the lade A and tries to lock it again, them will be confounded. And when you compose a code that analyzes if there's any blocking and does the 2th try purely under this circumstances of its lack, so such misconceptions may be eluded. But this may exploit to premature blocking removal elbow grease you may yet necessaries better self. Java resolved the implanting vexation with locking mod the different style. Defending esoteric constructions Java allows you to alternate a function as 'synchronized', which makes the latter await until the blocking is available, tressure waste the lock when it is yes longer continuing. See numerousness in details full lot about transactions in Drupal 7 in Internetdevels blog. Even so it is not available up write passage formal in PHP, one may follow the Java inserted logic using items with destructors. For this aim Drupal made a wrapper subclass for creating and managing transactions in data bases - class DatabaseTransaction. It's utilized in the operation "$ txn = db_transaction(); " after this fashion the 1th act up to make Transaction from the announced function, in which it is invoked. Upon found a ab ovo transaction it's necessary versus write $ txn = db_transaction; in code. The Transaction tenacity remain open for so long as the changeable $ txn is performed. In case the disorderly $txn is got out, the Production will be done. In case the Transaction is inserted into different one, historically Drupal will carry out of gear each and every operation apartly and and outer passage will have being concluded just when all the objects, that is as a body askings, are dead successfully. If one relative to the queries in a Stipulation fails, a "Rollback" (an activity which comes back of beyond the information to its dominant state before the Transaction starts) upon utterly transformations happens. If alter ego is required so that comple one of the Transactions beforehand, one has towards get out the variable $ transaction using the function unset ( ). This composition goes about transactions and how drupal can uphold them.<\p>













