Aaron (and all GX developers),
 
Make sure your OASIS montaj error level reporting is set to "Show all
errors" (See "Edit|Settings...", second dialog).  This will display errors
that help GX developers find problems in their code.  Some errors are
harmless to users, and are only displayed with error level set to full error
reporting.
 
In this case, unlocking an invalid handle in line 10 should stop the GX and
report a programming error.
 
We don't show all errors like this to users because there are a number of
GX's in existence that are a bit careless with things like locking, but
which have no effect to the user.
 
Ian
____________ 
Ian MacLeod 
[EMAIL PROTECTED]
(416) 369 0111 
fax 369 9599 
 

-----Original Message-----
From: Aaron Balasch [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 29, 2000 3:21 PM
To: [EMAIL PROTECTED]
Subject: [gxnet]: Locking and unlocking databases


There's no problem, just my curiosity at work. I've just been doing some
playing around and have come up with a few things on how the GX language
works and would just like to confirm these things if someone else out there
knows the answers. I've included a portion of code below. I've stuck in a
few trivial DisplayMessage_SYS() commands to track were i'm at in the
program operation.
 
1.        EData1 = Current_EDB();
2.        Data1=Lock_EDB(EData1);
3.        CreateSymb_DB(Data1, "c2hp15kbl", DB_SYMB_CHAN,
DB_OWNER_SHARED, DB_SYMB_SHARED_LONG);
 
4.     IStrcpy_STR(sExp, "c2hp15kbl=c2r_2passave_1-c21_hp15k", 64); 
5.     SetString_SYS("Math", "Exp", sExp);
6.     iRunGX_SYS("math.gx");
 
7.     EData1 = Current_EDB();
8.     Data1=Lock_EDB(EData1);
9       DisplayMessage_SYS("hi", "hi");
10.    UnLock_EDB(EData1);                //Unlock the edited database.
11.    DisplayMessage_SYS("hi", "hi1");
 
12.    EData1 = Current_EDB();
13.    Data1=Lock_EDB(EData1);
14.    Commit_DB(Data1);
15.    DisplayMessage_SYS("hi", "hi2");
16.    UnLock_EDB(EData1);           //Unlock the edited database.
17.    UnLoad_EDB(sDbin);                //Close the edited database.
 
Abort_SYS("DONE");
 
}
 
My first finding is that if I comment out lines 7 and 8, I get the first
DisplayMessage command but not the second. I assume that this is because the
GX hangs up at the Unlock_EDB command. I'm guessing this is because Edata1
is no longer a valid handle. I conclude that this is because when I run the
math.gx, Edata1 is somehow unlocked and destroyed. Since the math.gx does
uses Edata, not Edata1 as the handle, the only thing I can conclude is the
when math.gx Unlocks Edata, it also Unlocks all other EDB handles including
Edata1. Can anyone tell me if this is right?

My second finding is that if I comment out lines 7,8,10,12,13,14,16(all the
lines dealing with locking&unlocking the database and the commit statement),
I get to the "hi2" display message immediately before th Unload_EDB command
but the Database does not unload and I don't get to the Abort_SYS("DONE");
command. I don't really no what's going on here.

 

Aaron Balasch
Sky Hunter Technologies Inc.
Suite 101, 1725 10th Avenue S.W.
Calgary, Alberta T3C 0K1
Phone: (403)228-2175
Fax: (403)244-7955
email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 

_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html

Reply via email to