Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-level locking [CORE1272] #1693

Open
firebird-automations opened this issue May 20, 2007 · 10 comments
Open

User-level locking [CORE1272] #1693

firebird-automations opened this issue May 20, 2007 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Igor Lobov (ivl)

Votes: 3

User-level locking (Oracle DBMS_LOCK-like), witch automatic unlock on COMMIT or ROLLBACK

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

If you want your request(s) to be considered made more detailed explanation at least what it is and what problems it can solve

@firebird-automations
Copy link
Collaborator Author

Commented by: Igor Lobov (ivl)

For example:
1. Creating lock by DDL operator
CREATE LOCK LOCK_NAME
(As a variant -- without DDL operator)
2. In stored procedure or trigger, or etc. executing next statenment:
SET LOCK LOCK_NAME;
If this locking is the first then it is establishing, else processing of locking is standard.
3. Unlocking executing on COMMIT or ROLLBACK.

This mechanism will allow to organize parallel processing of great volumes of the information by several users.

Using UDF for this purpose do not allows to realize this opportunity in the context of transaction.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

MS SQL Server have the similar mechanism :
sp_getapplock (http://msdn2.microsoft.com/en-us/library/ms189823.aspx)
and
sp_releaseapplock http://msdn2.microsoft.com/en-us/library/ms178602.aspx

I think it is useful.

It can be partly emulated in Firebird by taking table lock at transaction start (via TPB)

@firebird-automations
Copy link
Collaborator Author

Commented by: Igor Lobov (ivl)

There is the simple example when locking of the table will not give expected effect.
If it is necessary to lock inserting in the table and at this time to allow changing in other transactions existing records, it is impossible with locking this table entirely.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Use another special table for locking purposes. Go to support list for details if needed

@firebird-automations
Copy link
Collaborator Author

Commented by: Igor Lobov (ivl)

Yes, the additional special table partially solves this problem.
But if i want to lock selecting for read only database i can not use the additional table.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

1 - I do see this as an application level problem.

2 - This could be resolved by using a series of SPs, which use Context variables (v2.0) as a mechanism for setting locks. The only problem is that the locks will not be automatically released by commit/rollback.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

The locks is related to data, so it's a perfect thing that the database could help the application.

While, for example, Oracle do his best to make people use PL/SQL and his extensions, we, unfortunately, do our best trying people to not use our things so they can go to others DBMSs easily.

Sigh.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12152 ] => Firebird [ 15573 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Igor Lobov (ivl)

Component: Engine [ 10000 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant