Board index » delphi » Delphi 3 and MS SQL Server 6.5 Locking Problem

Delphi 3 and MS SQL Server 6.5 Locking Problem

TC,

Quote
> Any idea what may be
> causing this problem?

are you using TTable?

-Jim

 

Re:Delphi 3 and MS SQL Server 6.5 Locking Problem


I have a Delphi 3 Client/Server application using the BDE native
drivers to access an MS SQL Server 6.5 database.  At one of my
client sites, there are up to 6 client PCs that could be running
the application at the same time.  Frequently, when there are two
or more concurrent users, a "lock-up" is occurring and doesn't
release until one of the users (and it's not the same one each
time) logs out (performs and end task).  Any idea what may be
causing this problem?

Re:Delphi 3 and MS SQL Server 6.5 Locking Problem


MS SQL 6.5 uses page locking by default.  For small tables this can
escalate to table locks easily.  There are configuration parameters to
request record-level locks with later service packs. (Can't remember the
details as its been too long, but I'm sure you can find threads in Google
newsgroup searches.)  The real solution is to move to 7.0 or 2000.
However, it is possible to workaround these problems with 6.5, even when
using the BDE.

"TC" <chislbe...@aol.com> wrote in news:3ca35864$1_2@dnews:

Quote
> I have a Delphi 3 Client/Server application using the BDE native
> drivers to access an MS SQL Server 6.5 database.  At one of my
> client sites, there are up to 6 client PCs that could be running
> the application at the same time.  Frequently, when there are two
> or more concurrent users, a "lock-up" is occurring and doesn't
> release until one of the users (and it's not the same one each
> time) logs out (performs and end task).  Any idea what may be
> causing this problem?

Re:Delphi 3 and MS SQL Server 6.5 Locking Problem


Jim,

Thanks for the response.  Yes, I am using TTable.

TC

Re:Delphi 3 and MS SQL Server 6.5 Locking Problem


TC,

One of the problems with using TTable with SQL Server
is that the TTable will cause table locks by its very nature.
It simple is not designed for use with a RDMS.
There has been some very recent discussion about this in
this newsgroup.

Other than to use TQuery instead I can't offer you any
advice on how to optimize TTable with SQL Server.

Regards,
Jim

Quote
"TC" <chislbe...@aol.com> wrote in message news:3ca9da45$1_2@dnews...

> Jim,

> Thanks for the response.  Yes, I am using TTable.

> TC

Re:Delphi 3 and MS SQL Server 6.5 Locking Problem


Hi TC!

On 28 Mar 2002 09:52:36 -0800, "TC" <chislbe...@aol.com> wrote:

Quote
>I have a Delphi 3 Client/Server application using the BDE native
>drivers to access an MS SQL Server 6.5 database.  At one of my
>client sites, there are up to 6 client PCs that could be running
>the application at the same time.  Frequently, when there are two
>or more concurrent users, a "lock-up" is occurring and doesn't
>release until one of the users (and it's not the same one each
>time) logs out (performs and end task).  Any idea what may be
>causing this problem?

First of all, use TQuery with SQL server and make small fetches of
data and complete the whole fetch when you open dataset (either call
FetchAll or go to the end of dataset).

When every you make a huge select in TQuery and do not complete the
fetch resources can be blocked because of open cursor and prevent
other users to write into the tables affected.

Follow my advice and you will start thinking the way SQL is designed
to be used for.

tomi.

Other Threads