Patent ID: 8041691

Claim:
A method for processing database statements, the method comprising: receiving, by a database server, a first database statement that specifies a modification to metadata of a database object, wherein the first database statement is included in a first database transaction; wherein a second database transaction, that is different than the first database transaction and that includes one or more data manipulation language (DML) statements, holds a certain lock on the database object when the first database statement is received; in response to receiving the first database statement, and before acquiring, on the metadata, any lock that is required by the first database statement, the database server, as part of the first database transaction: generating a second database statement which, when executed, causes a particular lock to be acquired on the database object, and executing the second database statement, wherein executing the second database statement comprises: the second database statement waiting for the second database transaction to release the certain lock, and the second database statement acquiring the particular lock on the database object only after the second database transaction releases the certain lock; while the particular lock is acquired for the second database statement, the database server executing the first database statement, which causes a first lock to be acquired on the metadata; and after the first lock is acquired on the metadata and while the metadata is locked with the first lock, modifying the metadata according to the first database statement; wherein the method is performed by one or more computing devices.