Mike,

 

A few thought about the code.

I believe the proper code to set null is:

SET NULL ‘-0-‘

The older versions of R:Base were more forgiving, but the newer versions are
more strict enforcing syntax.

 

Also, you are setting NULL to ‘-0-‘ and the beginning and then resetting it
to ‘ ‘ at the end of the code. Unlike variables that are local, the NULL
setting affects all users. It is possible that when you change the NULL
setting you are also resetting NULL to the “incorrect” setting’ for another
user.

I believe that using more than one NULL setting in a multi-user application
is asking for trouble. You should decide which one you want to use and stick
with that throughout the application. I would recommend using ‘-0-‘ all the
time.

 

You are using 9 command to update what seem to be the same record. You might
try combining the statements so you use only one command; I will guess it is
a lot faster as it locks the record only 1 time instead of nine.

You can use:

 

UPDATE scratchpd SET callfrom = .vcf, +

jphone = .vjph, +

wkphone = .valtph, +

ampmprom = .vamp, +

-- other columns go here

WHERE jidcode = .vjcd AND dtcall = .#DATE

 

I am not sure what is the purpose of the statement:

 

IF vdtprom1 = .vdtprom1 THEN…

 

This code will ALWAYS evaluate true as you are comparing a variable against
itself. You can take the IF-ENDIF code out and use the UPDATE command by
itself; it will work the same way.

 

Also, if do not have a “RETURN” at the end of your code , you should add one
as it could cause problems if it is missing. It is a good idea to R:Style
your code as it will find this type of errors.

 

I have run into this type of problems before , i.e. abnormal termination,
and I have found that in almost every case, there were small errors, as
simple as a missing comma, that created the problem; again, R:Style is a
great tool.

You should try running the code with:

 

SET MESSAGES ON

SET ERROR MESSAGESON

SET TRACE ON

To determine where the code stops and to check if an error code pops up.

 

FWIW, this is a version of the code I run on my startup file:

 

-- Set Basic Settings

SET MESSAGES OFF

SET ERROR MESSAGES OFF

 

SET QUOTES=NULL

SET QUOTES='

SET DELIMIT=NULL

SET DELIMIT=','

SET LINEEND=NULL

SET LINEEND='^'

SET SEMI=NULL

SET SEMI=';'

SET PLUS=NULL

SET PLUS='+'

SET SINGLE=NULL

SET SINGLE='_'

SET MANY=NULL

SET MANY='%'

SET IDQUOTES=NULL

SET IDQUOTES='`'

SET CURRENCY '$' PREF 2 B

 

DISCONNECT

 

SET STATICDB OFF

SET FASTLOCK OFF

 

SET ROWLOCKS ON

SET FEEDBACK OFF

 

-- This section sets up the scratch files...

SET SCRATCH TMP

 

-- Loading Application parameters

PROPERTY LOADWINDOW CAPTION 'Loading Road and Asset Management System...'

PROPERTY LOADWINDOW TITLE 'Please Wait...'

PROPERTY LOADWINDOW PROGRESS 100

 

-- Start Database

IF(CVAL('DATABASE')) <> 'PMSDB' OR (CVAL('DATABASE')) IS NULL THEN

  CONNECT PMSDB IDENTIFIED BY XXXXXXXXXX XXXXXXXXXX

ENDIF

 

-- Enforce Default Settings

SET QUOTES='

SET DELIMIT=','

SET LINEEND='þ'

SET SEMI=';'

SET PLUS='+'

SET SINGLE='_'

SET MANY='%'

SET IDQUOTES='`'

SET CURRENCY '$' PREF 2 B

SET NULL '-0-'

SET ZERO ON

SET DATE FORMAT MM/DD/YYYY

SET DATE SEQUENCE MMDDYY

SET DATE YEAR 30

SET DATE CENTURY 19

SET RBADMIN ON

 

The setting above works well in a multi-user compiled application.

 

Javier,

 

Javier Valencia, PE

O: 913-829-0888

H: 913-397-9605

C: 913-915-3137

 

From: [email protected] [mailto:[email protected]] On Behalf Of mike epstein
sony viao office
Sent: Sunday, April 08, 2012 6:54 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: MULTI USER PROBLEMS

 

Dave: There is a button on the form that updates a few tables  and exits
from the form. If there is another user connected to the database when the
‘save and exit’ button’s eep has run  then the form will not respond and the
option to exit the program on is the only solution . It is then that some of
the updated tables become locked and the user count increases. Which
requires both users to exit the program to clear.

I would love to blame it on ‘network issues’ but I really think it is an
rbase issue . This is the eep of the ‘save and exit button .

 

SET TRACE Off

SET MESSAGES OFF

SET ERROR MESSAGES On

SET NULL -0-

UPDATE scratchpd SET callfrom = .vcf WHERE jidcode = .vjcd AND dtcall =
.#DATE

UPDATE scratchpd SET jphone = .vjph WHERE jidcode = .vjcd AND dtcall =
.#DATE

 

UPDATE scratchpd SET wkphone = .valtph WHERE jidcode = .vjcd AND dtcall =
.#DATE

UPDATE scratchpd SET ampmprom = .vamp WHERE jidcode = .vjcd AND dtcall =
.#DATE

 

UPDATE scratchpd SET tmcall = .#TIME WHERE jidcode = .vjcd AND dtcall =
.#DATE

UPDATE scratchpd SET typbill = .vtycode WHERE jidcode = .vjcd AND dtcall =
.#DATE

 

UPDATE scratchpd SET dteprom = .vdtprom1 WHERE jidcode = .vjcd AND dtcall =
.#DATE

UPDATE scratchpd SET svcneed = .svcmo WHERE jidcode = .vjcd AND dtcall =
.#DATE

 

UPDATE scratchpd SET tidcode = .vtd WHERE jidcode = .vjcd AND dtcall =
.#DATE

 

IF vdtprom1 = .vdtprom1 THEN

  UPDATE scratchpd SET flag2 = 't' WHERE flag2 IS NULL AND dteprom = .#DATE

ENDIF

SET NULL '  '

closewindow

SET TRACE OFF

 

 

This routine saves all the data that is updated and closes the form …….ONLY
WHEN THERE IS ONLY 1 USER CONNECTED TO THE DATABASE

 

 

How would power management settings affect the form?   Neither of the
computers have been reset. 

 

Mike

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Dave McCann
Sent: Sunday, April 08, 2012 4:34 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: MULTI USER PROBLEMS

 

Mike: Does the "not responding" error occur every time the user exits the
form or after its been open for awhile?   I had a somewhat similar issue
where one workstation's power management settings were ultimately at fault -
make sure nothing powers down after a period of time.   My main menu form
would come up "not responding" after a period of inactivity and changing the
power settings solved it.


On 4/8/2012 10:20 AM, mike epstein sony viao office wrote: 

It has been a while since I have posted on this list . I am hoping someone
could help me with a problem.

 

In a multi user enviorment with the rx1-4 files  on a remote computer, and
with 2 users, there are  a number of forms that I have used for 3 or 4 years
in an application  That no longer work. On exit of the form the form will
signal the ‘not responding’ the little blue circle churns and the ‘rbase
extreme 9.1 ‘ message is displayed. When I ‘ close the program’ and then
restart the rbase application there are a number of table locks and when
using the ‘list’ command the number of users is over  2 .   This problem
only occurs when 2 users are logged on . Even when one of the 2 are just
connected to the database with the external form idle.   

 

My settings are 

multi on 

staticdb on

writechk off

qualcols 2

rowlocks  on 

wait 4

refresh  0

interval 5

 

 

Mike Epstein 

[email protected]

 

 

 

 

 

-- 
Dave McCann
Classic Micro Systems

Reply via email to