Database Blocking

R

Ragid

Hi all,
I want that a certain client access to the database would block any other
client access until another access of this specific client would unblock the
other clients.
Is that possible?
If positive, is it a feature of the framework?
Is it supported in all database types(I work with Firebird).
Regards
Ragid
 
A

Alberto Poblacion

Ragid said:
I want that a certain client access to the database would block any other
client access until another access of this specific client would unblock
the other clients.
Is that possible?
If positive, is it a feature of the framework?
Is it supported in all database types(I work with Firebird).


In general, this is achieved with a Transaction. You initiate a
transaction against the database and then access any database resources that
you require. The database will automatically lock those resources, and keep
them locked until you either commit or rollback the transaction.
This _should_ work against all databases, although I don't have any
experience with Firebird. Depending on your database, there may be various
"isolation levels" that can be specified when initiating the transaction and
will determine what kind of locks will be applied. Also, your specific SQL
dialect may allow various "hints" to be inserted in your SQL commands to
control locking (for instance, a hint may inform the server that you want a
full table lock rather than locking only the records touched by your
transaction).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top