Board index » delphi » Lockings in MSSQL Server 7.0

Lockings in MSSQL Server 7.0

Hi everybody!

Im programming a client/server application with Delphi and SQL Server
7.0.  I've been having lots of troubles  with table lockings in the SQL
server.  The application processes are being locked by another
mysterious process that is not generated as part of the client code nor
the server's stored procedures, I guess it's being generated by some BDE
instructions.  I really dont know what to do about it. I'm performing
all insert, update, delete operations as stored procedures.  I've
already deleted all kind of program or design relationship between
tables, and the lockings are still there.  If anybody of you have had
any kind of similar problem and have already solved it, please I would
be very thankful if you can e-mail me your solution.

Best Regards

Alcides Flores Pineda.

 

Re:Lockings in MSSQL Server 7.0


Alcides,

   Is the locking occurring when someone inserts/updates/deletes?  Are you
using TTables or TQuerys?  From a security standpoint, using stored
procedures for all data modification is a good idea, but a little more
difficult to track down these type of problems.  In Enterprise Manager you
can view who is blocking who and what transaction is taking place.

Good luck,
krf

Quote
Alcides Flores wrote in message <384C31CB.D5881...@servidor.unam.mx>...
>Hi everybody!

>Im programming a client/server application with Delphi and SQL Server
>7.0.  I've been having lots of troubles  with table lockings in the SQL
>server.  The application processes are being locked by another
>mysterious process that is not generated as part of the client code nor
>the server's stored procedures, I guess it's being generated by some BDE
>instructions.  I really dont know what to do about it. I'm performing
>all insert, update, delete operations as stored procedures.  I've
>already deleted all kind of program or design relationship between
>tables, and the lockings are still there.  If anybody of you have had
>any kind of similar problem and have already solved it, please I would
>be very thankful if you can e-mail me your solution.

>Best Regards

>Alcides Flores Pineda.

Re:Lockings in MSSQL Server 7.0


Alcides,

I wish this could help U a little bit. I think it applies in general to
similar blocking problem.

For TQuery objects,
    1). code in OnEditError to prevent editing blcoking:
            first cancel the changes, then set active property false and
true for refresh. then try edit again!
    2). also check qry's OnDelete, OnPost, do similar operation
For TTable objects,
    add exception statement, when error happens in save, delete, first
refresh the table and then U may try again for editing.

This is not happend only in Delphi, but also in Visual Basic. The principle
is the changes to the database by you or someone else are not reflected to
the data-aware control or dataset you are using at the moment, so you need
to refresh data from the database to get the edit priority by you, so you
can edit and save data rather smoothly.

Another solution is using CachesUpdate suggested by others.
--------------

Other Threads