Re: [U2] Locks in a transaction

2007-05-09 Thread john reid

The order I use is to build the key by using a routine, then cut the
KEY record lock loose, followed by a RECORDLOCK on the transaction to
be written.
We do a similar function, and have not seen signficant wait times.
If you're already doing that,  I'm not sure what could be occurring.

john

On 5/9/07, Moderator [EMAIL PROTECTED] wrote:

REPOSTED FOR NON-MEMBER: Greg Livingston [EMAIL PROTECTED]

I have a routine that runs in a transaction. Within the transaction I call a 
routine that generates the next sequential number for the record key.  The 
problem I'm having is that one of my customer records has so many transaction 
to process that it holds the lock on the key generation program and my other 
users then hang as they are waiting for the record to unlock.  Does anyone know 
a way of releasing the lock on a record with in a transaction before the final 
commit?
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/




--
john
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Locks in a transaction

2007-05-09 Thread Brutzman, Bill
I inherited a bunch of problematic final commits.  Per the following,
consider performing a Lock.And.Write as users change individual fields
within a record.

--Bill


*---

  SUBROUTINE SUB.LOCK.AND.WRITE.R1 ( R.This, This.File, Record.ID )

  prompt ''

  open This.File to F.This.File  else  gosub  Error.Opening.File

  gosub Lock.And.Write
  goThe.End

*---
--
*---
--
Lock.And.Write:

  Lock.Test = recordlocked (F.This.File, Record.ID) 

  begin case
case Lock.Test =  0   ;recordlocku F.This.File,
Record.ID   
  write R.This  on F.This.File,
Record.ID 
   release F.This.File,
Record.ID

case 1;  gosub Error.Record.Locking 
  end   case

return

*---
---
Error.Opening.File:

  crt @(-1)
  crt @(-5)

  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt '  Big Problem...' : @(-6)
  crt
  crt ' _  '
  crt ' \\  ' : This.File
  crt '  \   Error Opening File   \'
  crt '   \\Contact HK.IT  '
  crt '   [X]  ' 
  crt ''   :

  input Ans, 1
Ans  = upcase(Ans)

  begin case
case Ans = 'X'  ;  null
case 1  ;  go Error.Opening.File   
  end   case
  
return to The.End

*---
---
Error.Record.Locking:

  crt @(-1)
  crt @(-5)

  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt
  crt '  Big Problem...' : @(-6)
  crt
  crt ' _  '
  crt ' \\  ' : This.File
  crt '  \   Error, Record Lock   \'
  crt '   \\Contact HK.IT  '
  crt 
  crt ' Open New Gull Session, Try UNLOCK.ME
'   
  crt '
[X]  ' 
  crt '
'   :

  input Ans, 1
Ans  = upcase(Ans)

  begin case
case Ans = 'X'  ;  null
case 1  ;  go Error.Record.Locking
  end   case
  
return to The.End

*---
---
The.End:

  RETURN
  END

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Moderator
Sent: Wednesday, May 09, 2007 6:10 AM
To: u2-users@listserver.u2ug.org
Subject: [U2] Locks in a transaction


REPOSTED FOR NON-MEMBER: Greg Livingston [EMAIL PROTECTED]

I have a routine that runs in a transaction. Within the transaction I call a
routine that generates the next sequential number for the record key.  The
problem I'm having is that one of my customer records has so many
transaction to process that it holds the lock on the key generation program
and my other users then hang as they are waiting for the record to unlock.
Does anyone know a way of releasing the lock on a record with in a
transaction before the final commit?
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Locks in a transaction

2007-05-09 Thread Boydell, Stuart
Make sure that you do as little processing as possible within the actual
transaction so that the transaction is short and sweet.

Other than that, there is absolutely no way a lock should be released
before a transaction completes.





-Original Message-

REPOSTED FOR NON-MEMBER: Greg Livingston [EMAIL PROTECTED]



I have a routine that runs in a transaction. Within the transaction I
call a routine that

generates the next sequential number for the record key.  The problem
I'm having is

that one of my customer records has so many transaction to process that
it holds the

lock on the key generation program and my other users then hang as they
are waiting

for the record to unlock.  Does anyone know a way of releasing the lock
on a record

with in a transaction before the final commit?



**
This email message and any files transmitted with it are confidential and
intended solely for the use of addressed recipient(s). If you have received
this communication in error, please reply to this e-mail to notify the sender
of its incorrect delivery and then delete it and your reply.  It is your
responsibility to check this email and any attachments for viruses and defects
before opening or sending them on. Spotless collects information about you to
provide and market our services. For information about use, disclosure and
access, see our privacy policy at http://www.spotless.com.au
Please consider our environment before printing this email.
**
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Locks in a transaction

2007-05-09 Thread Hona, David S
It would defeat the entire purpose of a transactions to allow a lock to
be released during a transaction. 

Specifically, as the purpose is keep all related updates within the same
transaction. 

If this next key update function does not need or *should* not to be
rolled back, then this shouldn't be part of the transaction at all. I'm
guessing a rollback of this key would cause serious implications. :-)

As Stuart suggests...a redesign of update process to make the
transaction smaller maybe your only course of action.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Boydell, Stuart
Sent: Thursday, May 10, 2007 11:11 AM
To: u2-users@listserver.u2ug.org
Cc: [EMAIL PROTECTED]
Subject: RE: [U2] Locks in a transaction

Make sure that you do as little processing as possible within the actual
transaction so that the transaction is short and sweet.

Other than that, there is absolutely no way a lock should be released
before a transaction completes.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/