Board index » delphi » System seems to lock when more than one user tries to update

System seems to lock when more than one user tries to update

I have a program that runs okay, but on occassion if two or more users
click's apply or Ok at the same time it will take like 5 minutes or longer
for all to clear out and it will sometimes lock up completely.  When I look
at SQL server I see that one or two processes have been locked.  Is there a
way error trap for this and have the program retry every 5 seconds or so?  I
am using Delphi 4.0 and SQL 7.0.

Thanks

Dwaine Horton
York International
dwaine.hor...@york.com

 

Re:System seems to lock when more than one user tries to update


Dwaine,

   Blocking can be caused by a number of different factors and without
knowing more information, it is difficult to troubleshoot the problem.

What does clicking "apply' or 'OK' do?  What SQL is being sent to the
server?
Are you using TTables or TQuerys?  RequestLive, CachedUpdates, Midas?
BDE, ODBC, ADO?
Is Microsoft's Client Network Utility configured for TCP/IP or Named Pipes?

Good luck,
krf

Quote
Dwaine Horton <dwaine.hor...@york.com> wrote in message

news:3c42564b_1@dnews...
Quote
> I have a program that runs okay, but on occassion if two or more users
> click's apply or Ok at the same time it will take like 5 minutes or longer
> for all to clear out and it will sometimes lock up completely.  When I
look
> at SQL server I see that one or two processes have been locked.  Is there
a
> way error trap for this and have the program retry every 5 seconds or so?
I
> am using Delphi 4.0 and SQL 7.0.

> Thanks

> Dwaine Horton
> York International
> dwaine.hor...@york.com

Re:System seems to lock when more than one user tries to update


When they click Ok or Apply the program is trying to insert or update a
record through tqueries.  I have set several ODBC connections to point to
SQL and then they are used within BDE.

Quote
Kevin Frevert <kfrev...@midwayusa.com> wrote in message

news:3c432bb6_1@dnews...
Quote
> Dwaine,

>    Blocking can be caused by a number of different factors and without
> knowing more information, it is difficult to troubleshoot the problem.

> What does clicking "apply' or 'OK' do?  What SQL is being sent to the
> server?
> Are you using TTables or TQuerys?  RequestLive, CachedUpdates, Midas?
> BDE, ODBC, ADO?
> Is Microsoft's Client Network Utility configured for TCP/IP or Named
Pipes?

> Good luck,
> krf

> Dwaine Horton <dwaine.hor...@york.com> wrote in message
> news:3c42564b_1@dnews...
> > I have a program that runs okay, but on occassion if two or more users
> > click's apply or Ok at the same time it will take like 5 minutes or
longer
> > for all to clear out and it will sometimes lock up completely.  When I
> look
> > at SQL server I see that one or two processes have been locked.  Is
there
> a
> > way error trap for this and have the program retry every 5 seconds or
so?
> I
> > am using Delphi 4.0 and SQL 7.0.

> > Thanks

> > Dwaine Horton
> > York International
> > dwaine.hor...@york.com

Re:System seems to lock when more than one user tries to update


Dwaine,

   What version of Delphi/BDE?
   Are you using TQuery.RequestLive, CachedUpdates, your own script?

   Using MSSQL's Profiler, you can find out exactly what SQL is being used,
so from that, you can tweak your apps accordingly (the 'how do I do that?',
depends on the above questions).

Good luck,
krf

Quote
Dwaine Horton <dwaine.hor...@york.com> wrote in message

news:3c4455bd_2@dnews...
Quote
> When they click Ok or Apply the program is trying to insert or update a
> record through tqueries.  I have set several ODBC connections to point to
> SQL and then they are used within BDE.

Re:System seems to lock when more than one user tries to update


I am using Delphi 4 and BDE 5.  I am not using request live.

Is there a sql statement that I can execute to check and see if a table is
currently locked by another user.  I am thinking that I might could run this
before I run my other SQL statements and if the result is true then I can
use a timer to tell the system to wait.

Quote
Kevin Frevert <kfrev...@midwayusa.com> wrote in message

news:3c44587d$1_1@dnews...
Quote
> Dwaine,

>    What version of Delphi/BDE?
>    Are you using TQuery.RequestLive, CachedUpdates, your own script?

>    Using MSSQL's Profiler, you can find out exactly what SQL is being
used,
> so from that, you can tweak your apps accordingly (the 'how do I do
that?',
> depends on the above questions).

> Good luck,
> krf

> Dwaine Horton <dwaine.hor...@york.com> wrote in message
> news:3c4455bd_2@dnews...
> > When they click Ok or Apply the program is trying to insert or update a
> > record through tqueries.  I have set several ODBC connections to point
to
> > SQL and then they are used within BDE.

Re:System seems to lock when more than one user tries to update


Dwaine,

If your not using RequestLive, then how are you updating?   CachedUpdates?
Midas?  Your own scripts?  What components are you using?

krf

Quote
Dwaine Horton <dwaine.hor...@york.com> wrote in message

news:3c459cf0$1_1@dnews...
Quote
> I am using Delphi 4 and BDE 5.  I am not using request live.

> Is there a sql statement that I can execute to check and see if a table is
> currently locked by another user.  I am thinking that I might could run
this
> before I run my other SQL statements and if the result is true then I can
> use a timer to tell the system to wait.

Re:System seems to lock when more than one user tries to update


I use the command ExecSQL. IE - DM.qryinsertworkmast.ExecSQL; or
DM.qryupdateworkmast.ExecSQL;  But I think I have found a solution to my
problem.  I think that if I set the lock_timeout along with the waitfor
delay then I can have the queries running at different times.

Quote
Kevin Frevert <kfrev...@midwayusa.com> wrote in message

news:3c45a861_1@dnews...
Quote
> Dwaine,

> If your not using RequestLive, then how are you updating?   CachedUpdates?
> Midas?  Your own scripts?  What components are you using?

> krf

> Dwaine Horton <dwaine.hor...@york.com> wrote in message
> news:3c459cf0$1_1@dnews...
> > I am using Delphi 4 and BDE 5.  I am not using request live.

> > Is there a sql statement that I can execute to check and see if a table
is
> > currently locked by another user.  I am thinking that I might could run
> this
> > before I run my other SQL statements and if the result is true then I
can
> > use a timer to tell the system to wait.

Other Threads