[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference marin::forte-ft

Title:Forte' Field Test Conference
Notice:Forte R3 is due in summer...with lots of NEW features
Moderator:MARIN::ARVIND
Created:Wed Aug 04 1993
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:919
Total number of notes:3356

915.0. "Segmentation or access fault using DBResourceMgr" by NSIC01::KLERK (Thunderbirds are Go) Wed May 28 1997 08:21

   A client was playing with a small Forte program to experiment with
   opening DBsession's from a DBResourceMgr. Two small MS Access databases
   were opened using ODBC on Windows NT4. Both databases only have one
   table with one field and only one record with a text, identifying the
   database.
   What he does is the following:
     1. Start Forte application. This shows a form with 2 pairs of buttons
        "Session 1" / "delete session 1" and the same for session 2. These
	will create a DBSession1 via a Connect method or delete it using
	a disconnect.
     2. Press on "Session 1". In a text box the first record of the
        connected database is shown. You can do the same for Session 2.
     3. Press "Delete Session 1".
     4. Repeat steps 2 and 3 several times on either the session 1 or 2
        buttons (but using only the session 1 buttons suffices).
     5. After a small number of repeats (can be 2 times but also 6 times)
        Forte crashes without an error message and is completely removed
	from the screen. It always does this upon a "Delete Session".
	
   I switched on some logger flags, and after some trial and errors of what
   to switch on, I found that a setting of
       !stdout(err:sh:*:255 trc:db:*:255)
       dblogger.out(err:* trc:db:*:10 trc:os:10:10)
   for the FORTE_LOGGER_SETUP produced the following omnious message:

----------------------------------------------
[0x8b1:0x2.012] qqdb_OdbcRDBMS::FreeEnv          OLDLOCK db.Mutex (0x16f3288) joined
[0x8b1:0x2.012] qqdb_OdbcRDBMS::FreeEnv          Freeing the ODBC environment 009F52F0.
[0x8b1:0x2.012] DBSession::Disconnect            UNLOCK dbsesslock, Count:  0 <- 1
Begin Stack Backtrace ==========================================================
Trace caused by a segmentation or access violation in the Forte executable:

ftexec Version 2.0.F.2
Windows NT
Copyright (c) 1994, Forte Software, Inc.
All Rights Reserved.
Portions (c) Apple Computer Inc., (c) 1984-1990 FairCom Corporation,
(c) 1989-1993 Objectivity, Inc., (c) Servio Corporation
Fri Sep 20 22:19:50 1996

Fault at 28-May-1997 14:43:08, pid '169', node 'OCSWS1':
----------------------------------------------

    The code written doesn't do all that much tricky stuff and I cannot
    anything wrong sofar. Anyone with a suggestion?

    The pex file (98 kb) is entered in the next reply.
    The two MS Access 95 databases are called "test_db.mdb" and "albert_db.mdb"
    (copies of each other but for the actual row data):

    1 table by name "Tabel1"
           1 field by name "kolNaam" of type Text
	   value "test_db" or "test_albert" depending on the database.

    database name has an ODBC data resource name "test_db" or "albert_db"


    Puzzled,


    Theo
T.RTitleUserPersonal
Name
DateLines
915.1testdb.pexNSIC01::KLERKThunderbirds are GoWed May 28 1997 08:22249
begin TOOL test_out;

includes GenericDBMS;
includes DisplayProject;
includes Framework;

-- START FORWARD CLASS DECLARATIONS
forward testView is mapped;
-- END FORWARD CLASS DECLARATIONS

-- START FORWARD CURSOR DECLARATIONS
-- END FORWARD CURSOR DECLARATIONS

-- START CONSTANT DEFINITIONS
-- END CONSTANT DEFINITIONS

-- START C DATA TYPE DEFINITIONS
-- END C DATA TYPE DEFINITIONS

-- START CLASS DEFINITIONS

class testView is mapped inherits from DisplayProject.UserWindow

has private attribute kolNaam1: Framework.TextNullable;
has private attribute kolNaam2: Framework.TextNullable;
has private attribute DBSession01: GenericDBMS.DBSession;
has private attribute DBSession02: GenericDBMS.DBSession;

has public  method Init;
has public  method Display;
has public  method startDBSession01;
has private method startDBSession02;
has public  method setDspNaam1;
has public  method setDspNaam2;
has public  method createTable;
has public  method dropTable;
has public  method stopDBSession01;
has public  method stopDBSession02;

has property
        shared=(allow=on, override=on, default=off);
        transactional=(allow=on, override=on, default=off);
        monitored=(allow=on, override=on, default=off);
        distributed=(allow=off, override=off);

has
+51514631000004c9000004209fe4010100002101020000000002020600940800
+1d009fff010104210f1011120101011700009fff000000000900000bb80fa000
+000000000000000000010160600000000000000000009d0bb89d0fa000000105
+030301fffd0000000000000c04050006000002010001000013000001000b0300
+0021010200000000050400001c01000506007a08004d009fff010101010f1011
+120101011700009fff010000000900005dc05dbf000000000303030300020404
+a0a00000000000000000009d5dc09d5dbf00000105066b010000005dc05dbf00
+0600060000210802000000000708090a0b0c0d0e070600f60800890208086473
+704e61616d3101020b2121212121010101170001080854657874446174610c00
+0000099d050c9d01ea00c6065900000000030303030005010280a00000000000
+000000009cc69d0659000001030201070018000009ff8100009e004000140301
+00080600f60800890208086473704e61616d3201020b21212121210101011700
+02080854657874446174610d000000099d05019d03c900c60659000000000303
+03030005010280a00000000000000000009cc69d065900000103020107001800
+0009ff8100009e00400014030100090600780802010207075374617274303201
+020421212121212121211700039fff0f000000099d01df9d03d3010f027b0000
+00000303030300050101a0a00000000000000000009d010f9d027b0000010909
+0953657373696f6e20320002010a060078080201020c0c427574746f6e437265
+61746501020421212121212121211700049fff10000000099d01fe9d05d2010f
+02e4000000000303030300050101a0a00000000000000000009d010f9d02e400
+0001090c0c637265617465207461626c650002010b060078080201020a0a4275
+74746f6e44726f7001020421212121212121211700059fff11000000099d05c7
+9d05d2010f0286000000000303030300050101a0a00000000000000000009d01
+0f9d0286000001090a0a64726f70207461626c650002010c0600780802010207
+075374617274303101020421212121212121211700069fff0e000000099d01ca
+9d01d5010f027b000000000303030300050101a0a00000000000000000009d01
+0f9d027b00000109090953657373696f6e20310002010d060078080201020606
+53746f70303101020421212121212121211700079fff12000000099d0c4a9d01
+df010f03c9000000000303030300050101a0a00000000000000000009d010f9d
+03c900000109101064656c6574652053657373696f6e20310002010e06007808
+020102060653746f70303201020421212121212121211700089fff1300000009
+9d0c3f9d03be010f03c9000000000303030300050101a0a00000000000000000
+009d010f9d03c900000109101064656c6574652053657373696f6e2032000201
+0e1a7e898f9ce29cf49d01619d01ce9d022d9d02949d02f79d03569d03bb9d04
+2036191a385e5f6b7e88898d8f9cad9cd39cd49ce09ce29cec9cf49d01229d01
+4b9d014c9d014f9d01549d01619d018f9d01b89d01b99d01bc9d01c19d01ce9d
+01f39d021d9d021e9d022d9d02579d02819d02829d02949d02bc9d02e69d02e7
+9d02f79d031c9d03469d03479d03569d037a9d03a49d03a59d03bb9d03df9d04
+099d040a9d04200000
-02ac47dd


end class;
-- END CLASS DEFINITIONS

-- START SERVICE OBJECT DEFINITIONS
service db_server : GenericDBMS.DBResourceMgr = (DialogDuration = SESSION,
        Visibility = environment,
        ExternalManager = 'db',
        FailOver = FALSE,
        LoadBalance = FALSE) HAS PROPERTY extended = (UUID = '0F4C7C64-CDB5-11D0-85BA-FFD34557AA77');
-- END SERVICE OBJECT DEFINITIONS

-- START CURSOR DEFINITIONS
-- END CURSOR DEFINITIONS

-- START TYPEDEF DEFINITIONS
-- END TYPEDEF DEFINITIONS

-- START METHOD DEFINITIONS

------------------------------------------------------------
method testView.Init
begin
super.Init();
kolNaam1 = new;
kolNaam2 = new;

startDBSession01();
startDBSession02();

return;
end method;

------------------------------------------------------------
method testView.Display
begin
self.Open();
event loop
        when <Start01>.click do
                startDBSession01();
                setDspNaam1();
        when <Start02>.click do
                startDBSession02();
                setDspNaam2();  
        when <Stop01>.click do
                stopDBSession01();
        when <Stop02>.click do
                stopDBSession02();
        when <ButtonCreate>.click do
                startDBSession01();
                createTable();  
        when <ButtonDrop>.click do
                startDBSession01();
                dropTable();    
        when task.Shutdown do
                exit;
end event;
self.Close();
end method;

------------------------------------------------------------
method testView.startDBSession01
begin
if DBSession01 = NIL then
        DBSession01 = db_server.ConnectDB 
                (resourceName= 'test_db', 
                 userName='Admin',   
                 userPassword='');
end if;
return;
end method;

------------------------------------------------------------
method testView.startDBSession02
begin
if DBSession02 = NIL then
        DBSession02 = db_server.ConnectDB 
                (resourceName= 'albert_db', 
                 userName='Admin',   
                 userPassword='');
end if;
return;
end method;

------------------------------------------------------------
method testView.setDspNaam1
begin
if DBSession01 <> NIL then
        sql select top 1 kolNaam
                into :kolNaam1          
                from tabel1
                on session DBSession01;
        dspNaam1 = kolNaam1;
end if;
return;
end method;

------------------------------------------------------------
method testView.setDspNaam2
begin
if DBSession02 <> NIL then
        sql select top 1 kolNaam
                into :kolNaam2  
                from tabel1
                on session DBSession02;
        dspNaam2 = kolNaam2;
end if;
return;
end method;

------------------------------------------------------------
method testView.createTable
begin
if DBSession01 <> NIL then
        sql execute immediate 
                'create table test_tabel (veld01 integer)'
        on session DBSession01;
end if;
return;
end method;

------------------------------------------------------------
method testView.dropTable
begin
if DBSession01 <> NIL then
        sql execute immediate 
                'drop table test_tabel'
        on session DBSession01;
end if;
return;
end method;

------------------------------------------------------------
method testView.stopDBSession01
begin
if DBSession01 <> NIL then
        startDBSession01();
        DBSession01.disconnect;
        DBSession01 = NIL;
end if;
end method;

------------------------------------------------------------
method testView.stopDBSession02
begin
if DBSession02 <> NIL then
        startDBSession02();
        DBSession02.disconnect;
        DBSession02 = NIL;
end if;
end method;
-- END METHOD DEFINITIONS
HAS PROPERTY
        CompatibilityLevel = 0;
        ProjectType = APPLICATION;
        Restricted = FALSE;
        MultiThreaded = TRUE;
        LibraryName = 'test_out';
        StartingMethod = (class = testView, method = Display);


end test_out;
915.2Increase the stack sizeLEMAN::NAUFFRAYThu Jun 05 1997 00:3524
    Theo,
    
      It seems that probably the STACK size is not sufficient on your
    node. define the following environment variable before a new start :
    
          FORTE_STACK_SIZE  = 120000
    
      The default stack size value on NT is : 28672, which is even quite 
    reduced when your doing a intensive client activity, thus when you're
    acessing databases it's really small indeed.
    
    Hope this helps.
    
 James NAUFFRAY
 
 European Expertise Center for Enterprise Client-Server Softwares
 Digital Multivendor Customer Services
 Geneva, Switzerland
 Tel : (++41) 22-709-4782
 fax : (++41) 22-709-4451
    [email protected] 
 or [email protected]

    
915.3Or a timing problemNSIC01::KLERKThunderbirds are GoThu Jun 05 1997 02:2629
 James,

    Thanks. Meanwhile, Marc Mundy from Forte UK also responded with the
    following. I'll try both solution suggestions to see if it helps.
    Thanks.

   Theo


    ANALYSIS

This problem only occurs on NT 4.0 using MS Access via ODBC.  GPF occurs 
in SQLFreeConnect; however, if a sleep is placed between SQLDisconnect and
SQLFreeConnect, the GPF does not occur.


 I tried the following and this seemed to get it to fail very quickly


connect
get data
disconnect

but if I put a loop in between the get data and the disconnect, I did not
get the fail.

e.g. for i in 1 to 300000 do
     end for