Changes

Jump to navigation Jump to search
2,073 bytes added ,  10:37, 17 December 2010
*Durability
==Locking mechanismTransaction processing==
Each incoming Incoming requests are parsed and checked for errors on the server.If the query is not correct, the transaction will not be executed,and the user will recieve an error message When executing a transaction, all updates are stored in an updatelist. They will be executed all at once, so the database isupdated atomically. If any of the update subtransactions is classified into erroneous the overall transaction will be aborted. The concurrency control checks for each transaction, which willperform a read-only or writing write operation on the database, the status ofthe lock object and decides whether the isolation is guaranteedfor that transaction.After If this classification a is the case, the transaction will be started immediately.Otherwise, the transaction monitor decides if enters a transactionwaiting mode.  With the introduction of XQuery Update the complexity of theupdate operations increased, so now it's possible to addressnumerous databases and execute updates on them. Updates, which uses multiple databases can immediately start or not be executedwith a simple data lock. That's why BaseX uses a special lockobject, which controls the execution of the server process.This has the advantage that the used databases need not to wait for beknown and the correct execution is still granted. The disadvantage is that write operations are executed sequentially.Read-only operations are executed in parallel. For these reasons, a waiting list is used, which ensures that all processes aretreated equally and that they are executed accordingly to their sequence.This corresponds to the FIFO principle ('First-In First-Out'), which states thatthe first processes that arrives at the server, will be the end first one which willbe executed. The FIFO principle can not be adhered in a group of readingtransactions, as they run in different threads and thus can overtake each other . The use of the monitor also prevents the system from deadlocks, because the critical resource is only assigned to one writing transaction resp. a group ofreading transactions. So there is only one active transactionswriting transaction.  N.B.An abort of the server during a transaction will inevitably leadto an inconsistent database. A rollback of the transaction wouldprevent such an undesirable database state. Unfortunately,this feature is not <b>yet<b> available in the current version of BaseX.
[[Category:Server]]
[[Category:Internal]]
[[Category:Finish]]

Navigation menu