Normal Topic Mass Updating while other users are working (Read 595 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Mass Updating while other users are working
Sep 13th, 2007 at 7:13pm
Print Post Print Post  
Q&A never let me do a Mass Update while other users had the database open.  Unless I'm wrong, Sesame seems quite happy to allow me to do this.  If this is correct, what would happen if one of the records in my result set happens to be open by another user when the Mass Update comes to it?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Mass Updating while other users are working
Reply #1 - Sep 13th, 2007 at 7:20pm
Print Post Print Post  
Infinity wrote on Sep 13th, 2007 at 7:13pm:
Q&A never let me do a Mass Update while other users had the database open.  Unless I'm wrong, Sesame seems quite happy to allow me to do this.  If this is correct, what would happen if one of the records in my result set happens to be open by another user when the Mass Update comes to it?


If the Mass Update needs to change values in the record, the record is not updated as it is locked by the other user. If this is an issue, you can check and write yourself a log or WriteLn list of records that could not be updated.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Mass Updating while other users are working
Reply #2 - Sep 13th, 2007 at 7:44pm
Print Post Print Post  
Quote:
If the Mass Update needs to change values in the record, the record is not updated as it is locked by the other user. If this is an issue, you can check and write yourself a log or WriteLn list of records that could not be updated.

Ooh, that's an interesting idea.  But I'll need some more help.  What would I need to do to have Writeln show me such a list?  I know how to program Writeln, but I'm not sure how the record info would be "captured" for display.
  

**
Captain Infinity
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Mass Updating while other users are working
Reply #3 - Sep 14th, 2007 at 2:53am
Print Post Print Post  
Try something similar to this in your mass update spec. The idea of the @ReadOnly conditional, is that you want to use it to check an element that would normally never be read only. If the mass update finds that it IS read only, then it knows that it must be locked due to it being open already. (And that could even be the same user having it open in another mode.)

Code
Select All
If @ReadOnly(LastName) = 1
	{
	WriteLn("NOTICE!" + @NL() +
		"- The following record could NOT be updated." + @NL() +
		"  It was locked because it was already in use." + @NL() +
		@NL() +
		Tab(1) + "Record ID: " + @Str(RecordID) + @NL() +
		Tab(1) + "Last Name: " + LastName + @NL() +
		@NL() +
		"- You'll need to manually update that record." + @NL() +
		@NL() +
		"------------------------------------------------------------" + @NL())
	} 

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Mass Updating while other users are working
Reply #4 - Sep 14th, 2007 at 12:16pm
Print Post Print Post  
Carl, that is so cool!  Thanks!
  

**
Captain Infinity
Back to top
IP Logged