Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Thrashing is just virtual crashing.


devel / comp.lang.clipper.visual-objects / Vo2Ado and multiuser environment locks

SubjectAuthor
* Vo2Ado and multiuser environment locksSebastián BASSANO
+* Re: Vo2Ado and multiuser environment locksJamal
|`* Re: Vo2Ado and multiuser environment locksSebastián BASSANO
| +* Re: Vo2Ado and multiuser environment locksJamal
| |`- Re: Vo2Ado and multiuser environment locksSebastián BASSANO
| `* Re: Vo2Ado and multiuser environment locksJohnMartens
|  `* Re: Vo2Ado and multiuser environment locksSebastián BASSANO
|   `- Re: Vo2Ado and multiuser environment locksJohnMartens
`* Re: Vo2Ado and multiuser environment locksWolfgang Riedmann
 `- Re: Vo2Ado and multiuser environment locksSebastián BASSANO

1
Vo2Ado and multiuser environment locks

<ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1130&group=comp.lang.clipper.visual-objects#1130

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:622a:1303:b0:343:4d9b:46de with SMTP id v3-20020a05622a130300b003434d9b46demr7625920qtk.498.1661515127548;
Fri, 26 Aug 2022 04:58:47 -0700 (PDT)
X-Received: by 2002:a05:6214:c8f:b0:497:230:56e4 with SMTP id
r15-20020a0562140c8f00b00497023056e4mr7537117qvr.12.1661515127362; Fri, 26
Aug 2022 04:58:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Fri, 26 Aug 2022 04:58:47 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=190.31.232.147; posting-account=uZKv0QoAAADWPw3SFlyzu0XF3u85G-5e
NNTP-Posting-Host: 190.31.232.147
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
Subject: Vo2Ado and multiuser environment locks
From: ccyasa.sbassano@gmail.com (Sebastián BASSANO)
Injection-Date: Fri, 26 Aug 2022 11:58:47 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 63
 by: Sebastián BASSANO - Fri, 26 Aug 2022 11:58 UTC

Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:

// Get third party authorization code via web service
cAuthorizationCode:= oWebService:GetAuthorization(...)

// Update table
oConnection:BeginTrans()
cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
oConnection:Execute(cCommand, @liAffectedRecords, NIL)
if (liAffectedRecords > 0)
oConnection:CommitTrans()
ELSE
oConnection:Rollback()
ENDIF

This code doesn't work on multiuser environment because the record lock is applied on line:

oConnection:Execute(cCommand, @liAffectedRecords, NIL)

and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
If i'm correct ¿what would be the correct way to achieve this?

Maybe something this? I'm not convinced...

oConnection:BeginTrans()

// Force to lock the record updating value with the actual value
cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
oConnection:Execute(cCommand, @liAffectedRecords, NIL)

if (liAffectedRecords > 0)
// Get third party authorization code via web service
cAuthorizationCode:= oWebService:GetAuthorization(...)

// Update table
cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
oConnection:Execute(cCommand, @liAffectedRecords, NIL)
oConnection:CommitTrans()
ELSE
oConnection:Rollback()
ENDIF

I appreciate some help.
Regards.

Sebastián

Re: Vo2Ado and multiuser environment locks

<teb1j0$15nd$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1131&group=comp.lang.clipper.visual-objects#1131

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!i2pn.org!aioe.org!usMzckGswq/a27BPojtwGg.user.46.165.242.75.POSTED!not-for-mail
From: nospam@example.com (Jamal)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: Vo2Ado and multiuser environment locks
Date: Fri, 26 Aug 2022 13:57:52 -0400
Organization: Aioe.org NNTP Server
Message-ID: <teb1j0$15nd$1@gioia.aioe.org>
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="38637"; posting-host="usMzckGswq/a27BPojtwGg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Jamal - Fri, 26 Aug 2022 17:57 UTC

Try adding:

WITH (ROWLOCK)

to your SQL UPDATE statement.

"UPDATE document SET authorizationCode = " + cAuthorizationCode + " WITH
(ROWLOCK) WHERE (id = " + NTrim(cId) + ")"

Jamal

On 8/26/2022 7:58 AM, Sebastián BASSANO wrote:
> Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
> Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:
>
>
> // Get third party authorization code via web service
> cAuthorizationCode:= oWebService:GetAuthorization(...)
>
> // Update table
> oConnection:BeginTrans()
> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> if (liAffectedRecords > 0)
> oConnection:CommitTrans()
> ELSE
> oConnection:Rollback()
> ENDIF
>
>
> This code doesn't work on multiuser environment because the record lock is applied on line:
>
> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>
> and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
> I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
> If i'm correct ¿what would be the correct way to achieve this?
>
> Maybe something this? I'm not convinced...
>
>
> oConnection:BeginTrans()
>
> // Force to lock the record updating value with the actual value
> cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>
> if (liAffectedRecords > 0)
> // Get third party authorization code via web service
> cAuthorizationCode:= oWebService:GetAuthorization(...)
>
> // Update table
> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> oConnection:CommitTrans()
> ELSE
> oConnection:Rollback()
> ENDIF
>
>
> I appreciate some help.
> Regards.
>
> Sebastián

Re: Vo2Ado and multiuser environment locks

<d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1132&group=comp.lang.clipper.visual-objects#1132

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:620a:2b92:b0:6bc:6f7e:43ea with SMTP id dz18-20020a05620a2b9200b006bc6f7e43eamr688267qkb.616.1661537443921;
Fri, 26 Aug 2022 11:10:43 -0700 (PDT)
X-Received: by 2002:ac8:7f93:0:b0:344:ad82:aee7 with SMTP id
z19-20020ac87f93000000b00344ad82aee7mr822609qtj.332.1661537443769; Fri, 26
Aug 2022 11:10:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Fri, 26 Aug 2022 11:10:43 -0700 (PDT)
In-Reply-To: <teb1j0$15nd$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=186.109.169.146; posting-account=uZKv0QoAAADWPw3SFlyzu0XF3u85G-5e
NNTP-Posting-Host: 186.109.169.146
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com> <teb1j0$15nd$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>
Subject: Re: Vo2Ado and multiuser environment locks
From: ccyasa.sbassano@gmail.com (Sebastián BASSANO)
Injection-Date: Fri, 26 Aug 2022 18:10:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 92
 by: Sebastián BASSANO - Fri, 26 Aug 2022 18:10 UTC

El Friday, August 26, 2022 a la(s) 2:57:55 PM UTC-3, Jamal escribió:
> Try adding:
>
> WITH (ROWLOCK)
>
> to your SQL UPDATE statement.
>
> "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WITH
> (ROWLOCK) WHERE (id = " + NTrim(cId) + ")"
>
> Jamal
> On 8/26/2022 7:58 AM, Sebastián BASSANO wrote:
> > Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
> > Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:
> >
> >
> > // Get third party authorization code via web service
> > cAuthorizationCode:= oWebService:GetAuthorization(...)
> >
> > // Update table
> > oConnection:BeginTrans()
> > cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> > oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> > if (liAffectedRecords > 0)
> > oConnection:CommitTrans()
> > ELSE
> > oConnection:Rollback()
> > ENDIF
> >
> >
> > This code doesn't work on multiuser environment because the record lock is applied on line:
> >
> > oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >
> > and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
> > I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
> > If i'm correct ¿what would be the correct way to achieve this?
> >
> > Maybe something this? I'm not convinced...
> >
> >
> > oConnection:BeginTrans()
> >
> > // Force to lock the record updating value with the actual value
> > cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> > oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >
> > if (liAffectedRecords > 0)
> > // Get third party authorization code via web service
> > cAuthorizationCode:= oWebService:GetAuthorization(...)
> >
> > // Update table
> > cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> > oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> > oConnection:CommitTrans()
> > ELSE
> > oConnection:Rollback()
> > ENDIF
> >
> >
> > I appreciate some help.
> > Regards.
> >
> > Sebastián
Hi Jamal, thanks for your response.
the problem is that when a user reaches that line of code in the third party web service an authorization code has already been managed.

An example:

Time1 - User 1 open associated dialog to get authorization code on PC1
Time2 - User 2 open associated dialog to get authorization code on PC2
Time3 - User 1 get authorization code (before this i have to lock to avoid that other used get authorization code)
Time4 - User 1 update authorizarion code on database
Time5 - User 2 get authorization code
Time6 - User 2 update authorizarion code on database

I hope my problem is better understood, English is not my native language.
Regards.

Re: Vo2Ado and multiuser environment locks

<teb5sl$10id$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1133&group=comp.lang.clipper.visual-objects#1133

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!i2pn.org!aioe.org!usMzckGswq/a27BPojtwGg.user.46.165.242.75.POSTED!not-for-mail
From: nospam@example.com (Jamal)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: Vo2Ado and multiuser environment locks
Date: Fri, 26 Aug 2022 15:11:18 -0400
Organization: Aioe.org NNTP Server
Message-ID: <teb5sl$10id$1@gioia.aioe.org>
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
<teb1j0$15nd$1@gioia.aioe.org>
<d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="33357"; posting-host="usMzckGswq/a27BPojtwGg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Jamal - Fri, 26 Aug 2022 19:11 UTC

May be you can use the same approach when you SELECT the row and before
you get the authorization, then update the row.

If this does not work, try creating another table that indicates that
you're in an update process and handle your update process accordingly.

Jamal

On 8/26/2022 2:10 PM, Sebastián BASSANO wrote:
> El Friday, August 26, 2022 a la(s) 2:57:55 PM UTC-3, Jamal escribió:
>> Try adding:
>>
>> WITH (ROWLOCK)
>>
>> to your SQL UPDATE statement.
>>
>> "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WITH
>> (ROWLOCK) WHERE (id = " + NTrim(cId) + ")"
>>
>> Jamal
>> On 8/26/2022 7:58 AM, Sebastián BASSANO wrote:
>>> Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
>>> Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:
>>>
>>>
>>> // Get third party authorization code via web service
>>> cAuthorizationCode:= oWebService:GetAuthorization(...)
>>>
>>> // Update table
>>> oConnection:BeginTrans()
>>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>> if (liAffectedRecords > 0)
>>> oConnection:CommitTrans()
>>> ELSE
>>> oConnection:Rollback()
>>> ENDIF
>>>
>>>
>>> This code doesn't work on multiuser environment because the record lock is applied on line:
>>>
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>
>>> and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
>>> I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
>>> If i'm correct ¿what would be the correct way to achieve this?
>>>
>>> Maybe something this? I'm not convinced...
>>>
>>>
>>> oConnection:BeginTrans()
>>>
>>> // Force to lock the record updating value with the actual value
>>> cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>
>>> if (liAffectedRecords > 0)
>>> // Get third party authorization code via web service
>>> cAuthorizationCode:= oWebService:GetAuthorization(...)
>>>
>>> // Update table
>>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>> oConnection:CommitTrans()
>>> ELSE
>>> oConnection:Rollback()
>>> ENDIF
>>>
>>>
>>> I appreciate some help.
>>> Regards.
>>>
>>> Sebastián
> Hi Jamal, thanks for your response.
> the problem is that when a user reaches that line of code in the third party web service an authorization code has already been managed.
>
> An example:
>
> Time1 - User 1 open associated dialog to get authorization code on PC1
> Time2 - User 2 open associated dialog to get authorization code on PC2
> Time3 - User 1 get authorization code (before this i have to lock to avoid that other used get authorization code)
> Time4 - User 1 update authorizarion code on database
> Time5 - User 2 get authorization code
> Time6 - User 2 update authorizarion code on database
>
> I hope my problem is better understood, English is not my native language.
> Regards.

Re: Vo2Ado and multiuser environment locks

<853d9b96-9b6e-4cac-b60c-05abe26adc3en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1134&group=comp.lang.clipper.visual-objects#1134

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:ac8:5f92:0:b0:344:9d67:ff70 with SMTP id j18-20020ac85f92000000b003449d67ff70mr1048865qta.96.1661541374432;
Fri, 26 Aug 2022 12:16:14 -0700 (PDT)
X-Received: by 2002:a05:620a:4482:b0:6ba:c5af:8b8a with SMTP id
x2-20020a05620a448200b006bac5af8b8amr825246qkp.724.1661541374269; Fri, 26 Aug
2022 12:16:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Fri, 26 Aug 2022 12:16:14 -0700 (PDT)
In-Reply-To: <teb5sl$10id$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=186.109.169.146; posting-account=uZKv0QoAAADWPw3SFlyzu0XF3u85G-5e
NNTP-Posting-Host: 186.109.169.146
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
<teb1j0$15nd$1@gioia.aioe.org> <d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>
<teb5sl$10id$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <853d9b96-9b6e-4cac-b60c-05abe26adc3en@googlegroups.com>
Subject: Re: Vo2Ado and multiuser environment locks
From: ccyasa.sbassano@gmail.com (Sebastián BASSANO)
Injection-Date: Fri, 26 Aug 2022 19:16:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 110
 by: Sebastián BASSANO - Fri, 26 Aug 2022 19:16 UTC

El Friday, August 26, 2022 a la(s) 4:11:19 PM UTC-3, Jamal escribió:
> May be you can use the same approach when you SELECT the row and before
> you get the authorization, then update the row.
>
> If this does not work, try creating another table that indicates that
> you're in an update process and handle your update process accordingly.
>
> Jamal
> On 8/26/2022 2:10 PM, Sebastián BASSANO wrote:
> > El Friday, August 26, 2022 a la(s) 2:57:55 PM UTC-3, Jamal escribió:
> >> Try adding:
> >>
> >> WITH (ROWLOCK)
> >>
> >> to your SQL UPDATE statement.
> >>
> >> "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WITH
> >> (ROWLOCK) WHERE (id = " + NTrim(cId) + ")"
> >>
> >> Jamal
> >> On 8/26/2022 7:58 AM, Sebastián BASSANO wrote:
> >>> Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
> >>> Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:
> >>>
> >>>
> >>> // Get third party authorization code via web service
> >>> cAuthorizationCode:= oWebService:GetAuthorization(...)
> >>>
> >>> // Update table
> >>> oConnection:BeginTrans()
> >>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>> if (liAffectedRecords > 0)
> >>> oConnection:CommitTrans()
> >>> ELSE
> >>> oConnection:Rollback()
> >>> ENDIF
> >>>
> >>>
> >>> This code doesn't work on multiuser environment because the record lock is applied on line:
> >>>
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>>
> >>> and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
> >>> I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
> >>> If i'm correct ¿what would be the correct way to achieve this?
> >>>
> >>> Maybe something this? I'm not convinced...
> >>>
> >>>
> >>> oConnection:BeginTrans()
> >>>
> >>> // Force to lock the record updating value with the actual value
> >>> cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>>
> >>> if (liAffectedRecords > 0)
> >>> // Get third party authorization code via web service
> >>> cAuthorizationCode:= oWebService:GetAuthorization(...)
> >>>
> >>> // Update table
> >>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>> oConnection:CommitTrans()
> >>> ELSE
> >>> oConnection:Rollback()
> >>> ENDIF
> >>>
> >>>
> >>> I appreciate some help.
> >>> Regards.
> >>>
> >>> Sebastián
> > Hi Jamal, thanks for your response.
> > the problem is that when a user reaches that line of code in the third party web service an authorization code has already been managed.
> >
> > An example:
> >
> > Time1 - User 1 open associated dialog to get authorization code on PC1
> > Time2 - User 2 open associated dialog to get authorization code on PC2
> > Time3 - User 1 get authorization code (before this i have to lock to avoid that other used get authorization code)
> > Time4 - User 1 update authorizarion code on database
> > Time5 - User 2 get authorization code
> > Time6 - User 2 update authorizarion code on database
> >
> > I hope my problem is better understood, English is not my native language.
> > Regards.

Thanks, i will try in that way!

Re: Vo2Ado and multiuser environment locks

<teb6jt$2180$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1135&group=comp.lang.clipper.visual-objects#1135

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: martens@tennishulp.info (JohnMartens)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: Vo2Ado and multiuser environment locks
Date: Fri, 26 Aug 2022 21:23:40 +0200
Organization: A noiseless patient Spider
Lines: 98
Message-ID: <teb6jt$2180$1@dont-email.me>
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
<teb1j0$15nd$1@gioia.aioe.org>
<d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 26 Aug 2022 19:23:41 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f6229e390744c70e494aec8d2f59b38a";
logging-data="66816"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9lMxu/wfAeQKFtuFvXof5FKkW2+JYhn8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Cancel-Lock: sha1:8P3RHPCECoAPakL3NFMauM+C7xs=
In-Reply-To: <d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>
Content-Language: nl
 by: JohnMartens - Fri, 26 Aug 2022 19:23 UTC

Hi Sebastian,

Do you NEED to have two users to use the authorisation process at the
same time or do you want to avoid that thigs are messing up when users
try to use the procedure at the same time ?

If the latter is the case and you can have users wait for echt other you
could add a waiting list to a data base. If there is no waiting list,
start the process and it will run fine.
If there is a waiting list, add a user/PC specific ID to the end of the
waiting list, present the user with a waiting message and use a timer to
check once in a while if this waiting PC is now first in line and start
the auhorisation.
In this way serveral PC's/users may have small waiting time and youre
code can run free of errors

John

Op 26-8-2022 om 20:10 schreef Sebastián BASSANO:
> El Friday, August 26, 2022 a la(s) 2:57:55 PM UTC-3, Jamal escribió:
>> Try adding:
>>
>> WITH (ROWLOCK)
>>
>> to your SQL UPDATE statement.
>>
>> "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WITH
>> (ROWLOCK) WHERE (id = " + NTrim(cId) + ")"
>>
>> Jamal
>> On 8/26/2022 7:58 AM, Sebastián BASSANO wrote:
>>> Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
>>> Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:
>>>
>>>
>>> // Get third party authorization code via web service
>>> cAuthorizationCode:= oWebService:GetAuthorization(...)
>>>
>>> // Update table
>>> oConnection:BeginTrans()
>>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>> if (liAffectedRecords > 0)
>>> oConnection:CommitTrans()
>>> ELSE
>>> oConnection:Rollback()
>>> ENDIF
>>>
>>>
>>> This code doesn't work on multiuser environment because the record lock is applied on line:
>>>
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>
>>> and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
>>> I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
>>> If i'm correct ¿what would be the correct way to achieve this?
>>>
>>> Maybe something this? I'm not convinced...
>>>
>>>
>>> oConnection:BeginTrans()
>>>
>>> // Force to lock the record updating value with the actual value
>>> cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>
>>> if (liAffectedRecords > 0)
>>> // Get third party authorization code via web service
>>> cAuthorizationCode:= oWebService:GetAuthorization(...)
>>>
>>> // Update table
>>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>> oConnection:CommitTrans()
>>> ELSE
>>> oConnection:Rollback()
>>> ENDIF
>>>
>>>
>>> I appreciate some help.
>>> Regards.
>>>
>>> Sebastián
> Hi Jamal, thanks for your response.
> the problem is that when a user reaches that line of code in the third party web service an authorization code has already been managed.
>
> An example:
>
> Time1 - User 1 open associated dialog to get authorization code on PC1
> Time2 - User 2 open associated dialog to get authorization code on PC2
> Time3 - User 1 get authorization code (before this i have to lock to avoid that other used get authorization code)
> Time4 - User 1 update authorizarion code on database
> Time5 - User 2 get authorization code
> Time6 - User 2 update authorizarion code on database
>
> I hope my problem is better understood, English is not my native language.
> Regards.

Re: Vo2Ado and multiuser environment locks

<3112a339-5a6a-4a5d-ad42-079e329d92can@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1136&group=comp.lang.clipper.visual-objects#1136

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:ae9:ed89:0:b0:6bb:9968:de30 with SMTP id c131-20020ae9ed89000000b006bb9968de30mr897015qkg.774.1661542872292;
Fri, 26 Aug 2022 12:41:12 -0700 (PDT)
X-Received: by 2002:a05:6214:21cd:b0:496:db83:b779 with SMTP id
d13-20020a05621421cd00b00496db83b779mr986234qvh.53.1661542872149; Fri, 26 Aug
2022 12:41:12 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Fri, 26 Aug 2022 12:41:11 -0700 (PDT)
In-Reply-To: <teb6jt$2180$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=186.109.169.146; posting-account=uZKv0QoAAADWPw3SFlyzu0XF3u85G-5e
NNTP-Posting-Host: 186.109.169.146
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
<teb1j0$15nd$1@gioia.aioe.org> <d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>
<teb6jt$2180$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3112a339-5a6a-4a5d-ad42-079e329d92can@googlegroups.com>
Subject: Re: Vo2Ado and multiuser environment locks
From: ccyasa.sbassano@gmail.com (Sebastián BASSANO)
Injection-Date: Fri, 26 Aug 2022 19:41:12 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 6517
 by: Sebastián BASSANO - Fri, 26 Aug 2022 19:41 UTC

El Friday, August 26, 2022 a la(s) 4:23:42 PM UTC-3, JohnMartens escribió:
> Hi Sebastian,
>
> Do you NEED to have two users to use the authorisation process at the
> same time or do you want to avoid that thigs are messing up when users
> try to use the procedure at the same time ?
>
> If the latter is the case and you can have users wait for echt other you
> could add a waiting list to a data base. If there is no waiting list,
> start the process and it will run fine.
> If there is a waiting list, add a user/PC specific ID to the end of the
> waiting list, present the user with a waiting message and use a timer to
> check once in a while if this waiting PC is now first in line and start
> the auhorisation.
> In this way serveral PC's/users may have small waiting time and youre
> code can run free of errors
>
> John
>
>
> Op 26-8-2022 om 20:10 schreef Sebastián BASSANO:
> > El Friday, August 26, 2022 a la(s) 2:57:55 PM UTC-3, Jamal escribió:
> >> Try adding:
> >>
> >> WITH (ROWLOCK)
> >>
> >> to your SQL UPDATE statement.
> >>
> >> "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WITH
> >> (ROWLOCK) WHERE (id = " + NTrim(cId) + ")"
> >>
> >> Jamal
> >> On 8/26/2022 7:58 AM, Sebastián BASSANO wrote:
> >>> Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
> >>> Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:
> >>>
> >>>
> >>> // Get third party authorization code via web service
> >>> cAuthorizationCode:= oWebService:GetAuthorization(...)
> >>>
> >>> // Update table
> >>> oConnection:BeginTrans()
> >>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>> if (liAffectedRecords > 0)
> >>> oConnection:CommitTrans()
> >>> ELSE
> >>> oConnection:Rollback()
> >>> ENDIF
> >>>
> >>>
> >>> This code doesn't work on multiuser environment because the record lock is applied on line:
> >>>
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>>
> >>> and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
> >>> I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
> >>> If i'm correct ¿what would be the correct way to achieve this?
> >>>
> >>> Maybe something this? I'm not convinced...
> >>>
> >>>
> >>> oConnection:BeginTrans()
> >>>
> >>> // Force to lock the record updating value with the actual value
> >>> cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>>
> >>> if (liAffectedRecords > 0)
> >>> // Get third party authorization code via web service
> >>> cAuthorizationCode:= oWebService:GetAuthorization(...)
> >>>
> >>> // Update table
> >>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
> >>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
> >>> oConnection:CommitTrans()
> >>> ELSE
> >>> oConnection:Rollback()
> >>> ENDIF
> >>>
> >>>
> >>> I appreciate some help.
> >>> Regards.
> >>>
> >>> Sebastián
> > Hi Jamal, thanks for your response.
> > the problem is that when a user reaches that line of code in the third party web service an authorization code has already been managed.
> >
> > An example:
> >
> > Time1 - User 1 open associated dialog to get authorization code on PC1
> > Time2 - User 2 open associated dialog to get authorization code on PC2
> > Time3 - User 1 get authorization code (before this i have to lock to avoid that other used get authorization code)
> > Time4 - User 1 update authorizarion code on database
> > Time5 - User 2 get authorization code
> > Time6 - User 2 update authorizarion code on database
> >
> > I hope my problem is better understood, English is not my native language.
> > Regards.

Hi John, it is indeed the latter case.
I think I'm going to end up using your idea because I don't like what I was thinking of doing because it leaves the second user locked until the first user's transaction finishes (and I think with the option WITH
(ROWLOCK) option the same thing happens).
Thanks!

Re: Vo2Ado and multiuser environment locks

<tecdde$817g$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1137&group=comp.lang.clipper.visual-objects#1137

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: martens@tennishulp.info (JohnMartens)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: Vo2Ado and multiuser environment locks
Date: Sat, 27 Aug 2022 08:25:50 +0200
Organization: A noiseless patient Spider
Lines: 108
Message-ID: <tecdde$817g$1@dont-email.me>
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
<teb1j0$15nd$1@gioia.aioe.org>
<d68c452b-73b6-44ca-9c9a-f711e18018f3n@googlegroups.com>
<teb6jt$2180$1@dont-email.me>
<3112a339-5a6a-4a5d-ad42-079e329d92can@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 27 Aug 2022 06:25:50 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="a84bdf63465636cfb6387c17041f8359";
logging-data="263408"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tJpGGBZ/Q7nJmiRWuUMLpfIljsGZwts8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Cancel-Lock: sha1:bGU9bQy841lAxT9ZxW47vDmmilE=
Content-Language: nl
In-Reply-To: <3112a339-5a6a-4a5d-ad42-079e329d92can@googlegroups.com>
 by: JohnMartens - Sat, 27 Aug 2022 06:25 UTC

Hope it will get you to a solution
john

Op 26-8-2022 om 21:41 schreef Sebastián BASSANO:
> El Friday, August 26, 2022 a la(s) 4:23:42 PM UTC-3, JohnMartens escribió:
>> Hi Sebastian,
>>
>> Do you NEED to have two users to use the authorisation process at the
>> same time or do you want to avoid that thigs are messing up when users
>> try to use the procedure at the same time ?
>>
>> If the latter is the case and you can have users wait for echt other you
>> could add a waiting list to a data base. If there is no waiting list,
>> start the process and it will run fine.
>> If there is a waiting list, add a user/PC specific ID to the end of the
>> waiting list, present the user with a waiting message and use a timer to
>> check once in a while if this waiting PC is now first in line and start
>> the auhorisation.
>> In this way serveral PC's/users may have small waiting time and youre
>> code can run free of errors
>>
>> John
>>
>>
>> Op 26-8-2022 om 20:10 schreef Sebastián BASSANO:
>>> El Friday, August 26, 2022 a la(s) 2:57:55 PM UTC-3, Jamal escribió:
>>>> Try adding:
>>>>
>>>> WITH (ROWLOCK)
>>>>
>>>> to your SQL UPDATE statement.
>>>>
>>>> "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WITH
>>>> (ROWLOCK) WHERE (id = " + NTrim(cId) + ")"
>>>>
>>>> Jamal
>>>> On 8/26/2022 7:58 AM, Sebastián BASSANO wrote:
>>>>> Hi, i have an operation that needs to authorize a document via a third party web server and then update a table on my database. The process works fine but i need to add multiuser support, means that when an user is doing that operation the other users can't. I work with Vo2Ado.
>>>>> Today the code (simplified, without the BEGIN SEQUENCE/RECOVER USING code block) is similar to this:
>>>>>
>>>>>
>>>>> // Get third party authorization code via web service
>>>>> cAuthorizationCode:= oWebService:GetAuthorization(...)
>>>>>
>>>>> // Update table
>>>>> oConnection:BeginTrans()
>>>>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>>> if (liAffectedRecords > 0)
>>>>> oConnection:CommitTrans()
>>>>> ELSE
>>>>> oConnection:Rollback()
>>>>> ENDIF
>>>>>
>>>>>
>>>>> This code doesn't work on multiuser environment because the record lock is applied on line:
>>>>>
>>>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>>>
>>>>> and at this point two or more users could get more authorization codes because the third party web service don't receive any local information to test if the authorization code already exists. I need to lock the record before start the communication with web service.
>>>>> I understand that i can't lock records explicitly as with DbServer:LockCurrentRecord ¿is this correct?
>>>>> If i'm correct ¿what would be the correct way to achieve this?
>>>>>
>>>>> Maybe something this? I'm not convinced...
>>>>>
>>>>>
>>>>> oConnection:BeginTrans()
>>>>>
>>>>> // Force to lock the record updating value with the actual value
>>>>> cCommand:= "UPDATE document SET authorizationCode = authorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>>>
>>>>> if (liAffectedRecords > 0)
>>>>> // Get third party authorization code via web service
>>>>> cAuthorizationCode:= oWebService:GetAuthorization(...)
>>>>>
>>>>> // Update table
>>>>> cCommand:= "UPDATE document SET authorizationCode = " + cAuthorizationCode + " WHERE (id = " + NTrim(cId) + ")"
>>>>> oConnection:Execute(cCommand, @liAffectedRecords, NIL)
>>>>> oConnection:CommitTrans()
>>>>> ELSE
>>>>> oConnection:Rollback()
>>>>> ENDIF
>>>>>
>>>>>
>>>>> I appreciate some help.
>>>>> Regards.
>>>>>
>>>>> Sebastián
>>> Hi Jamal, thanks for your response.
>>> the problem is that when a user reaches that line of code in the third party web service an authorization code has already been managed.
>>>
>>> An example:
>>>
>>> Time1 - User 1 open associated dialog to get authorization code on PC1
>>> Time2 - User 2 open associated dialog to get authorization code on PC2
>>> Time3 - User 1 get authorization code (before this i have to lock to avoid that other used get authorization code)
>>> Time4 - User 1 update authorizarion code on database
>>> Time5 - User 2 get authorization code
>>> Time6 - User 2 update authorizarion code on database
>>>
>>> I hope my problem is better understood, English is not my native language.
>>> Regards.
>
> Hi John, it is indeed the latter case.
> I think I'm going to end up using your idea because I don't like what I was thinking of doing because it leaves the second user locked until the first user's transaction finishes (and I think with the option WITH
> (ROWLOCK) option the same thing happens).
> Thanks!

Re: Vo2Ado and multiuser environment locks

<jn8i7qFn7ruU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1138&group=comp.lang.clipper.visual-objects#1138

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: wriedmann@gmail.com (Wolfgang Riedmann)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: Vo2Ado and multiuser environment locks
Date: Wed, 31 Aug 2022 09:51:23 +0200
Lines: 23
Message-ID: <jn8i7qFn7ruU1@mid.individual.net>
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 8tBFBxgvX04YfqaP+e+6RA2y+mqlgeDWW17iN6renQmJDEpGs=
Cancel-Lock: sha1:CO6puzcbrw7r+AZTCkl4B5rnHP0=
User-Agent: XanaNews/1.18.1.6
 by: Wolfgang Riedmann - Wed, 31 Aug 2022 07:51 UTC

Hi Sebastián,

I would solve that in a completely different manner: I would add a
table "operations_in_progress", and when a user starts an authorization
process, I would first check if there is already a process active, and
if not, add a record there and start the authorization process.
If the authorization progress is successful, you can then write the
result to the document table, and remove the record from the in_progres
table in the same transaction.

Wolfgang

> Hi, i have an operation that needs to authorize a document via a
> third party web server and then update a table on my database. The
> process works fine but i need to add multiuser support, means that
> when an user is doing that operation the other users can't. I work
> with Vo2Ado.

--

Re: Vo2Ado and multiuser environment locks

<09c518e8-edf5-49b1-a1f5-8e8919d0c838n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1139&group=comp.lang.clipper.visual-objects#1139

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:622a:11c8:b0:343:4d55:3307 with SMTP id n8-20020a05622a11c800b003434d553307mr19148692qtk.306.1661950497356;
Wed, 31 Aug 2022 05:54:57 -0700 (PDT)
X-Received: by 2002:a05:622a:11d6:b0:343:5e19:7488 with SMTP id
n22-20020a05622a11d600b003435e197488mr18855432qtk.476.1661950497205; Wed, 31
Aug 2022 05:54:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Wed, 31 Aug 2022 05:54:56 -0700 (PDT)
In-Reply-To: <jn8i7qFn7ruU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=186.109.169.146; posting-account=uZKv0QoAAADWPw3SFlyzu0XF3u85G-5e
NNTP-Posting-Host: 186.109.169.146
References: <ab8087ef-f208-435b-98bf-407ce70e7a4an@googlegroups.com> <jn8i7qFn7ruU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <09c518e8-edf5-49b1-a1f5-8e8919d0c838n@googlegroups.com>
Subject: Re: Vo2Ado and multiuser environment locks
From: ccyasa.sbassano@gmail.com (Sebastián BASSANO)
Injection-Date: Wed, 31 Aug 2022 12:54:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2322
 by: Sebastián BASSANO - Wed, 31 Aug 2022 12:54 UTC

El Wednesday, August 31, 2022 a la(s) 4:51:25 AM UTC-3, Wolfgang Riedmann escribió:
> Hi Sebastián,
>
> I would solve that in a completely different manner: I would add a
> table "operations_in_progress", and when a user starts an authorization
> process, I would first check if there is already a process active, and
> if not, add a record there and start the authorization process.
> If the authorization progress is successful, you can then write the
> result to the document table, and remove the record from the in_progres
> table in the same transaction.
>
> Wolfgang
> > Hi, i have an operation that needs to authorize a document via a
> > third party web server and then update a table on my database. The
> > process works fine but i need to add multiuser support, means that
> > when an user is doing that operation the other users can't. I work
> > with Vo2Ado.
> --
Hi Wolfgang, just the way you indicate is the one I am finally implementing after reading John's answers.
Thanks!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor