Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Chuck Miller via 4D_Tech
You should test for is in read only mode and if so unload record/ set to read 
write and then load

Regards

Chuck

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
 mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  

This message and any attached documents contain information which may be 
confidential, subject to privilege or exempt from disclosure under applicable 
law.  These materials are intended only for the use of the intended recipient. 
If you are not the intended recipient of this transmission, you are hereby 
notified that any distribution, disclosure, printing, copying, storage, 
modification or the taking of any action in reliance upon this transmission is 
strictly prohibited.  Delivery of this message to any person other than the 
intended recipient shall not compromise or waive such confidentiality, 
privilege or exemption from disclosure as to this communication. 

> On Oct 11, 2018, at 5:03 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> //  $1 = ptr to table
> 
> $isLocked:=Locked($1->)
> 
> If ($isLocked)  // try loading the record & test again
> 
> LOAD RECORD($1->)
> 
> $isLocked:=Locked($1->)

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Kirk Brooks via 4D_Tech
Chuck,
You and Chip were actually close. The issue wasn't with the table being in
read only but rather the way I was dealing with loading the record if it
was 'locked'.
"If Locked returns TRUE, then the record cannot be saved because

- it is locked by another user
- another process
- it is stacked in the current process"

I seem to be hitting on #3 - it's stacked (though not sure how but that's
not the point here). My method actually attempted to deal with this by
calling LOAD RECORD but it did it in a complicated way (I wrote this method
a long time ago) and it didn't seem to be working in this case.

I simplified the locking method and this appears to have resolved the
issue. Here's the new code:

//  $1 = ptr to table

$isLocked:=Locked($1->)

If ($isLocked)  // try loading the record & test again

LOAD RECORD($1->)

$isLocked:=Locked($1->)

End if

Case of

: (Count parameters<2)

  //

: (Not($isLocked))

$text:=""

Else   // evaluate the locked record

LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)

PROCESS
PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)


$text:="["+Table name($1)+"] is locked.\r"+\

"It's locked by "+$4dUser+".\r\r"+\

"  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\

"  Process : "+$p_Name+"\r"+\

"   Proc # : "+String($process)+"\r"+\

" Alt name : "+$processName
$2->:=$text

End case   //$process=-1
  // 
$0:=$isLocked

I verified the code that brought this up would first get Locked=true but
after calling LOAD RECORD Locked=false.

I still think LOCKED BY should return the process info where the record is
stacked but I suppose there could be a number of processes doing that so
it's perhaps not germane.

I appreciate being able to talk this one out.

On Thu, Oct 11, 2018 at 1:31 PM Charles Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> OK here goes. Given the following code
> You will see that
> $proc=0
> and
> $user,$session,$name are all blank
>
> *READ ONLY*([Table])
>
> *Get a record*
>
> *FIRST RECORD*([Part])
>
> *LOAD RECORD*([Part])
>
> *If *(*Locked*([Part])
>
> *C_LONGINT*($proc)
>
> *c_text*($user;$session;$name)
>
> *LOCKED BY*([Part];$proc;$user;$session;$name)
>
>
>
>
> *end if*
>
>
> On Thu, Oct 11, 2018 at 4:18 PM Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > Chuck,
> > Well that supposes that the Locked command is not accurate. If that's
> wrong
> > I'm not sure how to prove that. And that would be a much more profound
> > problem, I think. But perhaps. I'm just assuming the issue is with the
> > Locked By command.
> >
> > To be clear my method tests for Locked first:
> >
> > Case of
> >
> > :() // some other stuff to validate the pointer
> >
> > :(Locked($table_p->))
> >
> > //  do the locked record stuff
> >
> > End case
> >
> >
> > Sure I can manipulate the records between locked and unlocked. The thing
> is
> > when I do those sorts of operations everything behaves as expected. This
> is
> > some sort of edge case, I just want to understand what the edge is.
> >
> > On Thu, Oct 11, 2018 at 11:14 AM Chuck Miller via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> > > Kirk
> > >
> > > In 15 I had found you could lock records think you unlocked them and
> then
> > > unloaded but they would remain locked until you quit server. What
> happens
> > > in your car if you select a different record. Do both show as locked
> only
> > > first or only the second
> > >
> > > Regards
> > >  Chuck
> > >
> > > Sent from my iPhone
> > >
> > > > On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech <
> > > 4d_tech@lists.4d.com> wrote:
> > > >
> > > > I have a method that tests if a record is locked and if it is
> attempts
> > to
> > > > figure out by whom:
> > > >
> > > > $text:="["+Table name($1)+"] "
> > > >
> > > > LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> > > > PROCESS
> > > >
> > >
> >
> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> > > >
> > > > Case of
> > > > : ($process=-1)
> > > >
> > > > $text:=$text+"The record has been deleted."
> > > >
> > > > : ($process=0)
> > > >
> > > > $text:=$text+" is locked but there is no information available about
> > who
> > > > has it."
> > > >
> > > > Else
> > > >
> > > > $text:=$text+\
> > > >
> > > > "Record number "+String(Record number($1->))+" is locked.\r"+\
> > > >
> > > > "It's open by "+$4dUser+".\r\r"+\
> > > >
> > > > "  Process : "+$p_Name+"\r"+\
> > > >
> > > > "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> > > >
> > > > "   Proc # : "+String($process)+"\r"+\
> > > >
> > > > " Alt name : "+$processName
> > > >
> > > > End case
> > > >
> > > >
> > > > I've been using this for years. Recently I noticed (but it may have
> > been
> > > > going on for a while) records will return true for locked but LOCKED
> BY
> > > > doesn't have any process associated with it. The only way I've been
> > able
> > > to
> > > > recreate this is to open a rec

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Charles Miller via 4D_Tech
OK here goes. Given the following code
You will see that
$proc=0
and
$user,$session,$name are all blank

*READ ONLY*([Table])

*Get a record*

*FIRST RECORD*([Part])

*LOAD RECORD*([Part])

*If *(*Locked*([Part])

*C_LONGINT*($proc)

*c_text*($user;$session;$name)

*LOCKED BY*([Part];$proc;$user;$session;$name)




*end if*


On Thu, Oct 11, 2018 at 4:18 PM Kirk Brooks via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Chuck,
> Well that supposes that the Locked command is not accurate. If that's wrong
> I'm not sure how to prove that. And that would be a much more profound
> problem, I think. But perhaps. I'm just assuming the issue is with the
> Locked By command.
>
> To be clear my method tests for Locked first:
>
> Case of
>
> :() // some other stuff to validate the pointer
>
> :(Locked($table_p->))
>
> //  do the locked record stuff
>
> End case
>
>
> Sure I can manipulate the records between locked and unlocked. The thing is
> when I do those sorts of operations everything behaves as expected. This is
> some sort of edge case, I just want to understand what the edge is.
>
> On Thu, Oct 11, 2018 at 11:14 AM Chuck Miller via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
> > Kirk
> >
> > In 15 I had found you could lock records think you unlocked them and then
> > unloaded but they would remain locked until you quit server. What happens
> > in your car if you select a different record. Do both show as locked only
> > first or only the second
> >
> > Regards
> >  Chuck
> >
> > Sent from my iPhone
> >
> > > On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> > >
> > > I have a method that tests if a record is locked and if it is attempts
> to
> > > figure out by whom:
> > >
> > > $text:="["+Table name($1)+"] "
> > >
> > > LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> > > PROCESS
> > >
> >
> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> > >
> > > Case of
> > > : ($process=-1)
> > >
> > > $text:=$text+"The record has been deleted."
> > >
> > > : ($process=0)
> > >
> > > $text:=$text+" is locked but there is no information available about
> who
> > > has it."
> > >
> > > Else
> > >
> > > $text:=$text+\
> > >
> > > "Record number "+String(Record number($1->))+" is locked.\r"+\
> > >
> > > "It's open by "+$4dUser+".\r\r"+\
> > >
> > > "  Process : "+$p_Name+"\r"+\
> > >
> > > "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> > >
> > > "   Proc # : "+String($process)+"\r"+\
> > >
> > > " Alt name : "+$processName
> > >
> > > End case
> > >
> > >
> > > I've been using this for years. Recently I noticed (but it may have
> been
> > > going on for a while) records will return true for locked but LOCKED BY
> > > doesn't have any process associated with it. The only way I've been
> able
> > to
> > > recreate this is to open a record in User Mode and attempt to load the
> > > record from another process. This works as expected. Then if I close
> the
> > > record in User and click off of it to deselect attempting to load from
> > > another process shows the record locked but no info.
> > >
> > > It also occurs other times though I haven't been able to replicate it.
> > > Regardless, what to do?
> > >
> > > This is v15 running on Mac Mojave so there is all sorts of
> possibilities
> > > for weirdness there. Wondering if anyone else has come across this?
> > >
> > > --
> > > Kirk Brooks
> > > San Francisco, CA
> > > ===
> > >
> > > *We go vote - they go home*
> > > **
> > > 4D Internet Users Group (4D iNUG)
> > > Archive:  http://lists.4d.com/archives.html
> > > Options: https://lists.4d.com/mailman/options/4d_tech
> > > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > > **
> >
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
>
>
> --
> Kirk Brooks
> San Francisco, CA
> ===
>
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Server connectivity
  http://www.informed-solutions.com
-

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Chuck Miller via 4D_Tech
What I am saying is if a table is in read only

Sent from my iPhone

> On Oct 11, 2018, at 4:18 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Chuck,
> Well that supposes that the Locked command is not accurate. If that's wrong
> I'm not sure how to prove that. And that would be a much more profound
> problem, I think. But perhaps. I'm just assuming the issue is with the
> Locked By command.
> 
> To be clear my method tests for Locked first:
> 
> Case of
> 
> :() // some other stuff to validate the pointer
> 
> :(Locked($table_p->))
> 
> //  do the locked record stuff
> 
> End case
> 
> 
> Sure I can manipulate the records between locked and unlocked. The thing is
> when I do those sorts of operations everything behaves as expected. This is
> some sort of edge case, I just want to understand what the edge is.
> 
> On Thu, Oct 11, 2018 at 11:14 AM Chuck Miller via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Kirk
>> 
>> In 15 I had found you could lock records think you unlocked them and then
>> unloaded but they would remain locked until you quit server. What happens
>> in your car if you select a different record. Do both show as locked only
>> first or only the second
>> 
>> Regards
>> Chuck
>> 
>> Sent from my iPhone
>> 
>>> On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech <
>> 4d_tech@lists.4d.com> wrote:
>>> 
>>> I have a method that tests if a record is locked and if it is attempts to
>>> figure out by whom:
>>> 
>>> $text:="["+Table name($1)+"] "
>>> 
>>> LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
>>> PROCESS
>>> 
>> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
>>> 
>>> Case of
>>> : ($process=-1)
>>> 
>>> $text:=$text+"The record has been deleted."
>>> 
>>> : ($process=0)
>>> 
>>> $text:=$text+" is locked but there is no information available about who
>>> has it."
>>> 
>>> Else
>>> 
>>> $text:=$text+\
>>> 
>>> "Record number "+String(Record number($1->))+" is locked.\r"+\
>>> 
>>> "It's open by "+$4dUser+".\r\r"+\
>>> 
>>> "  Process : "+$p_Name+"\r"+\
>>> 
>>> "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
>>> 
>>> "   Proc # : "+String($process)+"\r"+\
>>> 
>>> " Alt name : "+$processName
>>> 
>>> End case
>>> 
>>> 
>>> I've been using this for years. Recently I noticed (but it may have been
>>> going on for a while) records will return true for locked but LOCKED BY
>>> doesn't have any process associated with it. The only way I've been able
>> to
>>> recreate this is to open a record in User Mode and attempt to load the
>>> record from another process. This works as expected. Then if I close the
>>> record in User and click off of it to deselect attempting to load from
>>> another process shows the record locked but no info.
>>> 
>>> It also occurs other times though I haven't been able to replicate it.
>>> Regardless, what to do?
>>> 
>>> This is v15 running on Mac Mojave so there is all sorts of possibilities
>>> for weirdness there. Wondering if anyone else has come across this?
>>> 
>>> --
>>> Kirk Brooks
>>> San Francisco, CA
>>> ===
>>> 
>>> *We go vote - they go home*
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: https://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> 
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Kirk Brooks via 4D_Tech
Chip,
These aren't new records and in this case there aren't any transactions.

On Thu, Oct 11, 2018 at 11:48 AM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> if the record is new - other processes can not see it.
> if the record existed before the transaction, then it should show what
> process/user/etc has hold of it.
>
> beginning (I think) in v13 - if the table is read only, a selected
> record shows as locked.
> Chip
> On Thu, 11 Oct 2018 14:17:45 -0400, Randy Jaynes via 4D_Tech wrote:
> > My first thought is transaction in another process somewhere.
> >
> > Randy
> >
> > --
> > Randy Jaynes
> > Senior Programmer and Customer Support
> >
> > http://printpoint.com ∙ 845.687.3741 ∙ PrintPoint, Inc ∙ 57 Ludlow
> > Lane ∙ Palisades, NY 10964
> > Please send all email contacts to supp...@printpoint.com
> > 
> >
> >
> >
> >
> >> On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech
> >> <4d_tech@lists.4d.com> wrote:
> >>
> >> I have a method that tests if a record is locked and if it is attempts
> to
> >> figure out by whom:
> >>
> >> $text:="["+Table name($1)+"] "
> >>
> >> LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> >> PROCESS
> >>
>
> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> >>
> >> Case of
> >> : ($process=-1)
> >>
> >> $text:=$text+"The record has been deleted."
> >>
> >> : ($process=0)
> >>
> >> $text:=$text+" is locked but there is no information available about who
> >> has it."
> >>
> >> Else
> >>
> >> $text:=$text+\
> >>
> >> "Record number "+String(Record number($1->))+" is locked.\r"+\
> >>
> >> "It's open by "+$4dUser+".\r\r"+\
> >>
> >> "  Process : "+$p_Name+"\r"+\
> >>
> >> "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> >>
> >> "   Proc # : "+String($process)+"\r"+\
> >>
> >> " Alt name : "+$processName
> >>
> >> End case
> >>
> >>
> >> I've been using this for years. Recently I noticed (but it may have been
> >> going on for a while) records will return true for locked but LOCKED BY
> >> doesn't have any process associated with it. The only way I've been
> able to
> >> recreate this is to open a record in User Mode and attempt to load the
> >> record from another process. This works as expected. Then if I close the
> >> record in User and click off of it to deselect attempting to load from
> >> another process shows the record locked but no info.
> >>
> >> It also occurs other times though I haven't been able to replicate it.
> >> Regardless, what to do?
> >>
> >> This is v15 running on Mac Mojave so there is all sorts of possibilities
> >> for weirdness there. Wondering if anyone else has come across this?
> >>
> >> --
> >> Kirk Brooks
> >> San Francisco, CA
> >> ===
> >>
> >> *We go vote - they go home*
> >> **
> >> 4D Internet Users Group (4D iNUG)
> >> Archive:  http://lists.4d.com/archives.html
> >> Options: https://lists.4d.com/mailman/options/4d_tech
> >> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >> **
> >
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Kirk Brooks via 4D_Tech
Randy,
Agreed, but why won't Locked By provide information about it?

On Thu, Oct 11, 2018 at 11:17 AM Randy Jaynes via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> My first thought is transaction in another process somewhere.
>
> Randy
>
> --
> Randy Jaynes
> Senior Programmer and Customer Support
>
> http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane •
> Palisades, NY 10964
> Please send all email contacts to supp...@printpoint.com  supp...@printpoint.com>
>
>
>
>
> > On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > I have a method that tests if a record is locked and if it is attempts to
> > figure out by whom:
> >
> > $text:="["+Table name($1)+"] "
> >
> > LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> > PROCESS
> >
> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> >
> > Case of
> > : ($process=-1)
> >
> > $text:=$text+"The record has been deleted."
> >
> > : ($process=0)
> >
> > $text:=$text+" is locked but there is no information available about who
> > has it."
> >
> > Else
> >
> > $text:=$text+\
> >
> > "Record number "+String(Record number($1->))+" is locked.\r"+\
> >
> > "It's open by "+$4dUser+".\r\r"+\
> >
> > "  Process : "+$p_Name+"\r"+\
> >
> > "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> >
> > "   Proc # : "+String($process)+"\r"+\
> >
> > " Alt name : "+$processName
> >
> > End case
> >
> >
> > I've been using this for years. Recently I noticed (but it may have been
> > going on for a while) records will return true for locked but LOCKED BY
> > doesn't have any process associated with it. The only way I've been able
> to
> > recreate this is to open a record in User Mode and attempt to load the
> > record from another process. This works as expected. Then if I close the
> > record in User and click off of it to deselect attempting to load from
> > another process shows the record locked but no info.
> >
> > It also occurs other times though I haven't been able to replicate it.
> > Regardless, what to do?
> >
> > This is v15 running on Mac Mojave so there is all sorts of possibilities
> > for weirdness there. Wondering if anyone else has come across this?
> >
> > --
> > Kirk Brooks
> > San Francisco, CA
> > ===
> >
> > *We go vote - they go home*
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Kirk Brooks via 4D_Tech
Chuck,
Well that supposes that the Locked command is not accurate. If that's wrong
I'm not sure how to prove that. And that would be a much more profound
problem, I think. But perhaps. I'm just assuming the issue is with the
Locked By command.

To be clear my method tests for Locked first:

Case of

:() // some other stuff to validate the pointer

:(Locked($table_p->))

//  do the locked record stuff

End case


Sure I can manipulate the records between locked and unlocked. The thing is
when I do those sorts of operations everything behaves as expected. This is
some sort of edge case, I just want to understand what the edge is.

On Thu, Oct 11, 2018 at 11:14 AM Chuck Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Kirk
>
> In 15 I had found you could lock records think you unlocked them and then
> unloaded but they would remain locked until you quit server. What happens
> in your car if you select a different record. Do both show as locked only
> first or only the second
>
> Regards
>  Chuck
>
> Sent from my iPhone
>
> > On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > I have a method that tests if a record is locked and if it is attempts to
> > figure out by whom:
> >
> > $text:="["+Table name($1)+"] "
> >
> > LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> > PROCESS
> >
> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> >
> > Case of
> > : ($process=-1)
> >
> > $text:=$text+"The record has been deleted."
> >
> > : ($process=0)
> >
> > $text:=$text+" is locked but there is no information available about who
> > has it."
> >
> > Else
> >
> > $text:=$text+\
> >
> > "Record number "+String(Record number($1->))+" is locked.\r"+\
> >
> > "It's open by "+$4dUser+".\r\r"+\
> >
> > "  Process : "+$p_Name+"\r"+\
> >
> > "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> >
> > "   Proc # : "+String($process)+"\r"+\
> >
> > " Alt name : "+$processName
> >
> > End case
> >
> >
> > I've been using this for years. Recently I noticed (but it may have been
> > going on for a while) records will return true for locked but LOCKED BY
> > doesn't have any process associated with it. The only way I've been able
> to
> > recreate this is to open a record in User Mode and attempt to load the
> > record from another process. This works as expected. Then if I close the
> > record in User and click off of it to deselect attempting to load from
> > another process shows the record locked but no info.
> >
> > It also occurs other times though I haven't been able to replicate it.
> > Regardless, what to do?
> >
> > This is v15 running on Mac Mojave so there is all sorts of possibilities
> > for weirdness there. Wondering if anyone else has come across this?
> >
> > --
> > Kirk Brooks
> > San Francisco, CA
> > ===
> >
> > *We go vote - they go home*
> > **
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
>
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **



-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Charles Miller via 4D_Tech
I bet that is it. As I recall, in this instance locked by returns nothing
as it is not reallty locked

Regards

Chuck

On Thu, Oct 11, 2018 at 2:48 PM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> beginning (I think) in v13 - if the table is read only, a selected
> record shows as locked.
> Chip
>
>
> --
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Server connectivity
  http://www.informed-solutions.com
-
This message and any attached documents contain information which may be
confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution, disclosure,
printing, copying, storage, modification or the taking of any action in
reliance upon this transmission is strictly prohibited.  Delivery of this
message to any person other than the intended recipient shall not
compromise or waive such confidentiality, privilege or exemption
from disclosure as to this communication.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Chip Scheide via 4D_Tech
if the record is new - other processes can not see it.
if the record existed before the transaction, then it should show what 
process/user/etc has hold of it.

beginning (I think) in v13 - if the table is read only, a selected 
record shows as locked.
Chip 
On Thu, 11 Oct 2018 14:17:45 -0400, Randy Jaynes via 4D_Tech wrote:
> My first thought is transaction in another process somewhere.
> 
> Randy
> 
> --
> Randy Jaynes
> Senior Programmer and Customer Support
> 
> http://printpoint.com ∙ 845.687.3741 ∙ PrintPoint, Inc ∙ 57 Ludlow 
> Lane ∙ Palisades, NY 10964 
> Please send all email contacts to supp...@printpoint.com 
> 
> 
> 
> 
> 
>> On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> I have a method that tests if a record is locked and if it is attempts to
>> figure out by whom:
>> 
>> $text:="["+Table name($1)+"] "
>> 
>> LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
>> PROCESS
>> 
PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
>> 
>> Case of
>> : ($process=-1)
>> 
>> $text:=$text+"The record has been deleted."
>> 
>> : ($process=0)
>> 
>> $text:=$text+" is locked but there is no information available about who
>> has it."
>> 
>> Else
>> 
>> $text:=$text+\
>> 
>> "Record number "+String(Record number($1->))+" is locked.\r"+\
>> 
>> "It's open by "+$4dUser+".\r\r"+\
>> 
>> "  Process : "+$p_Name+"\r"+\
>> 
>> "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
>> 
>> "   Proc # : "+String($process)+"\r"+\
>> 
>> " Alt name : "+$processName
>> 
>> End case
>> 
>> 
>> I've been using this for years. Recently I noticed (but it may have been
>> going on for a while) records will return true for locked but LOCKED BY
>> doesn't have any process associated with it. The only way I've been able to
>> recreate this is to open a record in User Mode and attempt to load the
>> record from another process. This works as expected. Then if I close the
>> record in User and click off of it to deselect attempting to load from
>> another process shows the record locked but no info.
>> 
>> It also occurs other times though I haven't been able to replicate it.
>> Regardless, what to do?
>> 
>> This is v15 running on Mac Mojave so there is all sorts of possibilities
>> for weirdness there. Wondering if anyone else has come across this?
>> 
>> -- 
>> Kirk Brooks
>> San Francisco, CA
>> ===
>> 
>> *We go vote - they go home*
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Chip Scheide via 4D_Tech
Read only

On Thu, 11 Oct 2018 10:48:12 -0700, Kirk Brooks via 4D_Tech wrote:
> I have a method that tests if a record is locked and if it is attempts to
> figure out by whom:
> 
> $text:="["+Table name($1)+"] "
> 
> LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> PROCESS
> 
PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> 
> Case of
> : ($process=-1)
> 
> $text:=$text+"The record has been deleted."
> 
> : ($process=0)
> 
> $text:=$text+" is locked but there is no information available about who
> has it."
> 
> Else
> 
> $text:=$text+\
> 
> "Record number "+String(Record number($1->))+" is locked.\r"+\
> 
> "It's open by "+$4dUser+".\r\r"+\
> 
> "  Process : "+$p_Name+"\r"+\
> 
> "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> 
> "   Proc # : "+String($process)+"\r"+\
> 
> " Alt name : "+$processName
> 
> End case
> 
> 
> I've been using this for years. Recently I noticed (but it may have been
> going on for a while) records will return true for locked but LOCKED BY
> doesn't have any process associated with it. The only way I've been able to
> recreate this is to open a record in User Mode and attempt to load the
> record from another process. This works as expected. Then if I close the
> record in User and click off of it to deselect attempting to load from
> another process shows the record locked but no info.
> 
> It also occurs other times though I haven't been able to replicate it.
> Regardless, what to do?
> 
> This is v15 running on Mac Mojave so there is all sorts of possibilities
> for weirdness there. Wondering if anyone else has come across this?
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Randy Jaynes via 4D_Tech
My first thought is transaction in another process somewhere.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane • 
Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com 





> On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have a method that tests if a record is locked and if it is attempts to
> figure out by whom:
> 
> $text:="["+Table name($1)+"] "
> 
> LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> PROCESS
> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> 
> Case of
> : ($process=-1)
> 
> $text:=$text+"The record has been deleted."
> 
> : ($process=0)
> 
> $text:=$text+" is locked but there is no information available about who
> has it."
> 
> Else
> 
> $text:=$text+\
> 
> "Record number "+String(Record number($1->))+" is locked.\r"+\
> 
> "It's open by "+$4dUser+".\r\r"+\
> 
> "  Process : "+$p_Name+"\r"+\
> 
> "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> 
> "   Proc # : "+String($process)+"\r"+\
> 
> " Alt name : "+$processName
> 
> End case
> 
> 
> I've been using this for years. Recently I noticed (but it may have been
> going on for a while) records will return true for locked but LOCKED BY
> doesn't have any process associated with it. The only way I've been able to
> recreate this is to open a record in User Mode and attempt to load the
> record from another process. This works as expected. Then if I close the
> record in User and click off of it to deselect attempting to load from
> another process shows the record locked but no info.
> 
> It also occurs other times though I haven't been able to replicate it.
> Regardless, what to do?
> 
> This is v15 running on Mac Mojave so there is all sorts of possibilities
> for weirdness there. Wondering if anyone else has come across this?
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Chuck Miller via 4D_Tech
Kirk

In 15 I had found you could lock records think you unlocked them and then 
unloaded but they would remain locked until you quit server. What happens in 
your car if you select a different record. Do both show as locked only first or 
only the second 

Regards
 Chuck 

Sent from my iPhone

> On Oct 11, 2018, at 1:48 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have a method that tests if a record is locked and if it is attempts to
> figure out by whom:
> 
> $text:="["+Table name($1)+"] "
> 
> LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
> PROCESS
> PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)
> 
> Case of
> : ($process=-1)
> 
> $text:=$text+"The record has been deleted."
> 
> : ($process=0)
> 
> $text:=$text+" is locked but there is no information available about who
> has it."
> 
> Else
> 
> $text:=$text+\
> 
> "Record number "+String(Record number($1->))+" is locked.\r"+\
> 
> "It's open by "+$4dUser+".\r\r"+\
> 
> "  Process : "+$p_Name+"\r"+\
> 
> "  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\
> 
> "   Proc # : "+String($process)+"\r"+\
> 
> " Alt name : "+$processName
> 
> End case
> 
> 
> I've been using this for years. Recently I noticed (but it may have been
> going on for a while) records will return true for locked but LOCKED BY
> doesn't have any process associated with it. The only way I've been able to
> recreate this is to open a record in User Mode and attempt to load the
> record from another process. This works as expected. Then if I close the
> record in User and click off of it to deselect attempting to load from
> another process shows the record locked but no info.
> 
> It also occurs other times though I haven't been able to replicate it.
> Regardless, what to do?
> 
> This is v15 running on Mac Mojave so there is all sorts of possibilities
> for weirdness there. Wondering if anyone else has come across this?
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *We go vote - they go home*
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

What causes a record to be Locked but Locked By has no info?

2018-10-11 Thread Kirk Brooks via 4D_Tech
I have a method that tests if a record is locked and if it is attempts to
figure out by whom:

$text:="["+Table name($1)+"] "

LOCKED BY($1->;$process;$4Duser;$machineName;$p_Name)
PROCESS
PROPERTIES($process;$processName;$procState;$procTime;$procVisible;$uniqueID;$origin)

Case of
: ($process=-1)

$text:=$text+"The record has been deleted."

: ($process=0)

$text:=$text+" is locked but there is no information available about who
has it."

Else

$text:=$text+\

"Record number "+String(Record number($1->))+" is locked.\r"+\

"It's open by "+$4dUser+".\r\r"+\

"  Process : "+$p_Name+"\r"+\

"  Machine : "+$machineName+"\r\r"+("-"*20)+"\r"+\

"   Proc # : "+String($process)+"\r"+\

" Alt name : "+$processName

End case


I've been using this for years. Recently I noticed (but it may have been
going on for a while) records will return true for locked but LOCKED BY
doesn't have any process associated with it. The only way I've been able to
recreate this is to open a record in User Mode and attempt to load the
record from another process. This works as expected. Then if I close the
record in User and click off of it to deselect attempting to load from
another process shows the record locked but no info.

It also occurs other times though I haven't been able to replicate it.
Regardless, what to do?

This is v15 running on Mac Mojave so there is all sorts of possibilities
for weirdness there. Wondering if anyone else has come across this?

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**