SE501433C2 - Ways to obtain data access in a primary memory-based database - Google Patents

Ways to obtain data access in a primary memory-based database

Info

Publication number
SE501433C2
SE501433C2 SE9302175A SE9302175A SE501433C2 SE 501433 C2 SE501433 C2 SE 501433C2 SE 9302175 A SE9302175 A SE 9302175A SE 9302175 A SE9302175 A SE 9302175A SE 501433 C2 SE501433 C2 SE 501433C2
Authority
SE
Sweden
Prior art keywords
database
attribute
data
agent
code
Prior art date
Application number
SE9302175A
Other languages
Swedish (sv)
Other versions
SE9302175L (en
SE9302175D0 (en
Inventor
Bo Mikael Samuelsson
Original Assignee
Ellemtel Utvecklings Ab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ellemtel Utvecklings Ab filed Critical Ellemtel Utvecklings Ab
Priority to SE9302175A priority Critical patent/SE501433C2/en
Publication of SE9302175D0 publication Critical patent/SE9302175D0/en
Priority to KR1019950705890A priority patent/KR960703251A/en
Priority to PCT/SE1994/000600 priority patent/WO1995000907A1/en
Priority to JP7502716A priority patent/JPH08512151A/en
Priority to BR9406910-7A priority patent/BR9406910A/en
Priority to CA002165774A priority patent/CA2165774A1/en
Priority to CN94192575A priority patent/CN1125991A/en
Priority to AU70888/94A priority patent/AU7088894A/en
Priority to EP94919941A priority patent/EP0705460A1/en
Publication of SE9302175L publication Critical patent/SE9302175L/en
Publication of SE501433C2 publication Critical patent/SE501433C2/en
Priority to NO955276A priority patent/NO955276L/en
Priority to FI956243A priority patent/FI956243A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/4493Object persistence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/40Data acquisition and logging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

When an object (18) in a primary memory based data base (2) is accessed by a user, there is created in the user process (14) an agent object (16), that contains a reference (20) to the real object (18), and appears as if it were the real object. All accesses to the data of the object (18) are performed by reading directly, via the reference (20) in the agent object, in the memory of the storage manager (4). The data accesses are performed via a generic interface (12), in the form of read and write operations towards attributes.

Description

501 433 2 används finns lagrad i primärminnet. När filen inte används ligger de båda nivåerna lagrade i sekundärminnet. När access av en sida i sekundärminnet önskas utnyttjas indexnivån som inne- håller index-ingångar med referenser till de block i sekundär- minnet där sidan finns lagrad. Indexnivån innehåller alltså referenser till "objekt" i sekundärminnet för att korta ned accesstiden. 501 433 2 used is stored in the primary memory. When the file is not in use, both levels are stored in the secondary memory. When access to a page in the secondary memory is desired, the index level that contains index entries with references to the blocks in the secondary memory where the page is stored is used. The index level thus contains references to "objects" in the secondary memory to shorten the access time.

EP,A2, 381.447 avser en metod för att korta ned accesstiden från ett minne. För att öka prestanda hos ett datorsystem är det vanligt, speciellt om systemet har flera användare, att använda virtuell minnesadressering (virtual memory systems). Om flera program samtidigt vill ha tillgång till en minnesarea så före- ligger en risk för en konfliktsituation om minnet adresseras med den verkliga fysiska adressen. Olika program skulle kunna tänkas försöka både skriva och läsa på samma adress med trolig sön- derskrivning som följd. Virtuell adressering innebär att pro- grammet accessar ett objekt från minnet som om adressen vore den verkliga fysiska adressen för objektet i minnet. I själva verket finns det en enhet mellan processorn och minnet som översätter den virtuella adressen till den fysiska. Enheten har också möjlighet att mellanlagra dessa adresser för att kunna organise- ra adressering från flera program. Detta innebär att varje program kan adressera minnet som om programmet vore ensamt i systemet.EP, A2, 381,447 relates to a method for shortening the access time from a memory. To increase the performance of a computer system, it is common, especially if the system has several users, to use virtual memory addressing (virtual memory systems). If several programs want access to a memory area at the same time, there is a risk of a conflict situation if the memory is addressed with the actual physical address. Different programs could conceivably try to both write and read at the same address with probable spelling as a result. Virtual addressing means that the program accesses an object from memory as if the address were the actual physical address of the object in memory. In fact, there is a device between the processor and the memory that translates the virtual address into the physical one. The unit also has the option of temporarily storing these addresses in order to be able to organize addressing from several programs. This means that each program can address the memory as if the program were alone in the system.

Det är sålunda känt genom ovanstående dokumenten att via någon slags mellannivå erhålla access till en minnesarea. I det första dokumentet sker detta genom åberopande av en objektlista för att erhålla adressen till ett objekt, i det andra dokumentet utnyttjas en indexnivå för att erhålla access till ett intres- sant avsnitt som finns lagrat i ett sekundärminne, och i det sista dokumentet används en virtuell adress som översätts i en enhet mellan processorn och minnet för att erhålla access direkt till minnet.It is thus known from the above documents to gain access to a memory area via some kind of intermediate level. In the first document this is done by invoking an object list to obtain the address of an object, in the second document an index level is used to obtain access to an interesting section which is stored in a secondary memory, and in the last document a virtual address that is translated into a device between the processor and the memory to gain direct access to the memory.

Redogörelse för uppfinningen.Disclosure of the invention.

Syftet med uppfinningen är att åstadkomma ett sätt av in- ledningsvis angivet slag, som i jämförelse med teknikens stånd- punkt ger prestandafördelar, kort svarstid vid öppning, och ej kräver någon återkopiering till databasen efter uppdatering. 501 433 3 Detta syfte har enligt uppfinningen uppnåtts genom de i patentkraven angivna kännetecknen.The object of the invention is to provide a method of the kind initially stated, which in comparison with the state of the art gives performance advantages, short response time when opened, and does not require any feedback to the database after updating. This object has according to the invention been achieved by the features stated in the claims.

Då ett objekt i databasen accessas av en användare skapas i användareprocessen bara ett agentobjekt, som innehåller en referens till det riktiga objektet. Agentobjektet uppträder som om det var det riktiga objektet, men alla accesser till objek- tets data sker genom att via den lagrade referensen läsa direkt i databashanterarens minne. Dataaccesserna görs via ett gene- riskt gränssnitt, i form av läs- och skrivoperationer mot attri- but.When an object in the database is accessed by a user, only an agent object is created in the user process, which contains a reference to the real object. The agent object appears as if it were the real object, but all access to the object's data is done by reading directly into the database manager's memory via the stored reference. The data accesses are made via a generic interface, in the form of read and write operations against the attribute.

Koden för agentobjekten generas från en objekttypsbeskrivning i ett speciellt datadefinitionsspråk.The code for the agent objects is generated from an object type description in a special data definition language.

Figurbeskrivning.Figure description.

Uppfinningen skall nu beskrivas närmare med hjälp av utför- ingsexempel och med hänvisning till bifogade ritningar, på vilka fig. 1 schematiskt i blockschemaform åskådliggör enligt upp- finningen genomförd dataaccess i en primärminnesbaserad databas, fig. 2 schematiskt åskådliggör den logiska, eller virtuella adressrymden i den miljö med delat minne, i vilken databasens databashanterare arbetar, fig. 3 schematiskt i blockschemaform åskådliggör generering av kod för ett enligt uppfinningen i en användarprocess skapat agentobjekt.The invention will now be described in more detail with the aid of exemplary embodiments and with reference to the accompanying drawings, in which Fig. 1 schematically illustrates data access according to the invention in a primary memory-based database, Fig. 2 schematically illustrates the logical or virtual address space in the shared memory environment in which the database manager of the database operates, Fig. 3 schematically illustrates in block diagram form the generation of code for an agent object created according to the invention in a user process.

Föredragna utföringsformer.Preferred embodiments.

Den aktuella databasen, allmänt antydd vid 2 i fig. 1 och 2, är objektorienterad, d.v.s. dess data är organiserade som ob- jekt. Ett objekt är en sammanhållen mängd data, som kan läsas antingen direkt eller genom att anropa metoder i objektet.The current database, generally indicated at 2 in Figs. 1 and 2, is object oriented, i.e. its data are organized as objects. An object is a coherent amount of data, which can be read either directly or by calling methods in the object.

Den i databasen ingående databashanteraren 4 arbetar i en miljö med delat primärminne, vars logiska adressrymd framgår av fig.2, där varje process tilldelas en privat minnesarea 6, 6', 6"...etc., i vilken den har både läs och skrivrättigheter, varvid den emellertid också har läsrättigheter i gemensamma delar såsom databas 2, kod 8 och operativsystemets data 10. I den logiska adressrymden kan samma adress finnas i flera pro- cessers lokala minne, men mappas mot olika adresser i det fysis- ka minnet. För de gemensamma delarna gäller att samtliga pro- 501 433 4 cesser har samma mappning mellan logisk och fysisk adress.The database manager 4 included in the database operates in an environment with shared primary memory, the logical address space of which is shown in Fig. 2, where each process is assigned a private memory area 6, 6 ', 6 "... etc., In which it has both read and write rights, however, it also has read rights in common parts such as database 2, code 8 and the operating system data 10. In the logical address space, the same address can be in the local memory of several processes, but mapped to different addresses in the physical memory. For the common parts, all 501 433 4 processes have the same mapping between logical and physical address.

Det är möjligheten att ge användarens (klientens) process läsrättighet men inte skrivrättighet till databasens minnesarea, som möjliggör realisering av objektaccessen på det sätt som upp- finningen bygger på, och som kommer att förklaras närmare nedan.It is the possibility of giving the user's (client's) process the right to read but not the right to write to the database's memory area, which enables the realization of the object access in the way on which the invention is based, and which will be explained in more detail below.

Databashanteraren 4, som är en del av operativsystemet, erbjuder mot tillämpningen ett generiskt gränssnitt 12, nedan även benämnt DMI-snitt (DMI = Database Manager Interface), som skall kunna användas av alla användare. DMI-gränssnittet är av lågnivåkaraktär, och innehåller bland annat inga mekanismer för typsäkerhet.The database manager 4, which is part of the operating system, offers the application a generic interface 12, hereinafter also referred to as the DMI (Database Manager Interface), which must be usable by all users. The DMI interface is of a low-level nature, and contains, among other things, no mechanisms for type security.

All access av data sker genom att ett objekt öppnas. Indata till öppningsoperationen är objekttyp, primärnyckel och vilken typ av access till objektet användaren behöver. Vid öppnings- operationen lokaliseras objektet med hjälp av primärnyckeln, och åsätts aktuella låstyp. I samband härmed sker kontroll av om det finns andra processer som använder objektet.All access to data takes place by opening an object. Input data for the opening operation is object type, primary key and the type of access to the object the user needs. During the opening operation, the object is located with the help of the primary key, and the current lock type is assigned. In connection with this, a check is made as to whether there are other processes that use the object.

Resultatet av öppningsoperationen blir att en användare 14 får en pekare 15 till ett agentobjekt 16. Agentobjektet 16 har det verkliga objektets gränssnitt, men innehåller inte några av objektets attribut. I stället innehåller agentobjektet 16 en referens till objektets data, som ligger kvar i en datapost 18 i databasen 2. Agentobjektet 16 accessar databasposten 18 via det generiska gränssnittet 12, i form av läs- och skrivoperationer mot attribut. Referensen till databasposten 18 är i princip en pekare 20, varvid denna dock är realiserad på ett sätt som möjliggör kontroll av att referensen är giltig.The result of the opening operation is that a user 14 gets a pointer 15 to an agent object 16. The agent object 16 has the interface of the real object, but does not contain any of the attributes of the object. Instead, the agent object 16 contains a reference to the object's data, which remains in a data record 18 in the database 2. The agent object 16 accesses the database record 18 via the generic interface 12, in the form of read and write operations against attributes. The reference to the database record 18 is in principle a pointer 20, however, this is realized in a way that enables checking that the reference is valid.

Koden för objektets metoder nås via en form av dynamisk länkningsmekanism, som medger att en användare som öppnar ett lagrat objekt inte behöver ha koden för det öppnade objektets klass inlänkad i samma laddmodul. Länkningen sker i samband med att agentobjektet skapas.The code for the object's methods is accessed via a form of dynamic linking mechanism, which allows a user who opens a stored object not to have the code for the class of the opened object linked in the same load module. The linking takes place in connection with the creation of the agent object.

Den dynamiska länkningsmekanismen medger också att det öppnade objektet är en specialisering i förhållande till det, som den öppnande processen förväntar sig. Närmare bestämt kan det faktiska öppnade objektet ha metoder och attribut, som inte den öppnande processen känner till, och metoder som den känner till kan vara realiserade på annat sätt än i basklassen. Koden för den specialiserade objekttypen kommer processen åt med hjälp 5Û1 433 5 av den dynamiska länkningsmekanismen utan att den behöver vara känd då klientkoden kompileras och länkas.The dynamic linking mechanism also allows the opened object to be a specialization relative to what the opening process expects. More specifically, the actual opened object may have methods and attributes which the opening process does not know, and methods which it knows may be realized in other ways than in the base class. The code for the specialized object type is accessed by the process by the dynamic linking mechanism without it having to be known when the client code is compiled and linked.

Agentobjektet 16, nedan även benämnt "DOA" (Data Object Agent) bidrar med följande till databashanterarens 4 funktiona- litet: - Ett gränssnitt 22, nedan benämnt "DOI" (Data Object agent Interface).The agent object 16, hereinafter also referred to as "DOA" (Data Object Agent), contributes the following to the functionality of the database manager 4: - An interface 22, hereinafter referred to as "DOI" (Data Object agent Interface).

- Typkontroll i DOI-snittet.- Type control in the DOI section.

- Döljande av attributnummer.- Hiding attribute numbers.

- Genomföring av uppdatering av dubbelriktade referenser.- Implementation of updating of bidirectional references.

- Döljande av distribution och adressering.Hiding distribution and addressing.

- “Triggers", dvs användardefinierade rutiner, som exekveras vid en viss definierad händelse, normalt en uppdatering av ett attribut i ett lagrat øbjekt.- "Triggers", ie user-defined routines, which are executed at a certain defined event, normally an update of an attribute in a stored object.

- Knytning till transaktioner.- Linking to transactions.

DMI-gränssnittets 12 funktion skall nu beskrivas närmare. Som framgått av ovanstående överförs objekt inte till användarpro- cessen 14 vid access, utan i stället skapas ett agentobjekt 16, vilket kan accessa objektets data 18 direkt från databashantera- rens 4 minnesavsnitt. För att förhindra att användarprocessen 14 då på grund av ett eventuellt programmeringsfel kan skriva sönder data i databasen 2 krävs att denna access görs genom anrop av rutiner i databashanteraren 4. Databashanteraren 4 kan då upptäcka om användarprocessen 14 försöker skriva i ett objekt den inte har öppnat för uppdatering. Anropen till databashante- raren 4 sker i form av så kallade trap-anrop, som innebär över- gång till supervisor-mode. Koden som exekverar i supervisormode har möjlighet att skriva i samtliga delar av datorns minne, medan användarprocessen 14 endast har tillgång till sin egen privata minnesarea 6.The function of the DMI interface 12 will now be described in more detail. As stated above, objects are not transferred to the user process 14 upon access, but instead an agent object 16 is created, which can access the object's data 18 directly from the database manager 4's memory section. In order to prevent the user process 14 from being able to write data in the database 2 due to a possible programming error, this access is required by calling routines in the database manager 4. The database manager 4 can then detect if the user process 14 is trying to write in an object it has not opened for update. The calls to the database manager 4 take the form of so-called trap calls, which involve a transition to supervisor mode. The code executing in supervisor mode has the ability to write in all parts of the computer's memory, while the user process 14 only has access to its own private memory area 6.

Databashanterarens 4 kod, och gränssnittet 12 till den måste vara generiska, dvs utformade för att passa alla objekttyper som skall hanteras, även sådana som inte är i detalj kända vid konstruktionen av databashanteraren 4. Av den anledningen är gränssnittet 12 utformat så att DMI-operationerna skall kunna hantera alla typer av objekt som kommer att lagras i databasen 2, utan någon kännedom om datatypers representation och seman- tik. DMI-snittet 12 har därför en lågnivåkaraktär som gör det olämpligt som direkt programmeringsgränssnitt för tillämpnings- 501 433 konstruktion.The database manager 4 code, and the interface 12 to it must be generic, i.e. designed to suit all object types to be handled, even those not known in detail in the construction of the database manager 4. For this reason, the interface 12 is designed so that the DMI operations shall be able to handle all types of objects that will be stored in database 2, without any knowledge of data types' representation and semantics. The DMI interface 12 therefore has a low level character which makes it unsuitable as a direct programming interface for application design.

Det tidigare ovan använda begreppet typsäkerhet är ett begrepp inom programmeringsspråk, som innebär att kompilatorn kan kontrollera att variabler används på ett konsekvent sätt i hela programmet. Programmeraren deklarerar vilken typ av data som skall lagras i variabler. Med typdefinitionen bestäms repre- sentation och tolkning av informationen som lagras i en varia- bel. Normalt typdeklareras variabler, konstanter samt parametrar och returvärden till funktioner i ett program.The previously used concept of type certainty is a concept in programming languages, which means that the compiler can check that variables are used in a consistent way throughout the program. The programmer declares the type of data to be stored in variables. The type definition determines the representation and interpretation of the information stored in a variable. Normally, variables, constants as well as parameters and return values are declared for functions in a program.

Deklarationen gör det möjligt för kompilatorn att variabeln används på avsett sätt. Exempelvis förhindras användning av ett heltal som parameter till en funktion där det förväntas en teckensträng.The declaration enables the compiler to use the variable as intended. For example, the use of an integer as a parameter to a function where a character string is expected is prevented.

En närmare beskrivning med hjälp av pseudokod skall nu ske av de metoder, som enligt uppfinningen används för access och hantering av data i databasen 2. Följande konvention kommer därvid att användas: Vid varje förekomst föregås avsnitt med Kommentarer av 1; Användarens kod av 2; Genererad kod av 3; Generell kod i databashanteraren av 4; - Läsaccess. 1; Antag att vi har objekttypen Person i databasen. Att accessa ett objekt går till på följande sätt: 2; Person::openDirtyRead() // Riktat till genererad klassmetod.(C++ syntax) 3; Klassmetoden anropar DMI-gränssnittets generiska open- metod parametrar: objekttypsnummer och primärnyckelvärde, varav objekttypsnumret är inkodat i den genererade open- metoden. 4; Databashanteraren lokaliserar aktuellt objekt med hjälp av sökindex. 501 433 7 Pekare, dvs fysisk minnesadress till den lokaliserade data- basposten läggs in i en tabell, och ett checksummerat index till tabellen returneras till den genererade open-metoden.A more detailed description by means of pseudocode will now be made of the methods used according to the invention for accessing and handling data in the database 2. The following convention will then be used: For each occurrence, a section is preceded by Comments of 1; User code of 2; Generated code of 3; General code in the database manager of 4; - Reading access. 1; Assume that we have the object type Person in the database. Accessing an object is as follows: 2; Person :: openDirtyRead () // Aimed at generated class method (C ++ syntax) 3; The class method calls the generic open method of the DMI interface parameters: object type number and primary key value, of which the object type number is encoded in the generated open method. 4; The database manager locates the current object using the search index. 501 433 7 Pointers, ie the physical memory address of the located database entry, are entered into a table, and a checksum index to the table is returned to the generated open method.

Databasposten innehåller en referens till ett klassobjekt som i sin tur innehåller bl a en pekare till DOA-klassens kon- struktör. Med hjälp av denna skapas ett DOA-objekt av faktisk klass, i användarprocessens minnesarea. I DOA-objektet lagras det checksummerade indexet till adresstabellen.The database entry contains a reference to a class object which in turn contains, among other things, a pointer to the DOA class constructor. With the help of this, a DOA object of actual class is created, in the memory area of the user process. In the DOA object, the checksum index is stored to the address table.

Pekaren till DOA-objektet returneras till open-metoden. 3; Open-metoden returnerar pekaren till användaren. l; DOA-objektet kan nu fungera som en agent för det lagrade objektet. Access av attributet skonummer i objektet går till på följande sätt: 2; Skonummer = PersonDOA->Skonummer 3; Attributet skonummer representeras i DOA-objektet av en metod med samma namn. Metoden anropar DMI-operationen för att läsa attributvärden, med parametrarna offset och adressta- bell-index. 4; Databashanteraren lokaliserar databasposten med hjälp av adresstabellen, och returnerar värdet av angivet attribut. 3; DOA returnerar anropet till klienten.The pointer to the DOA object is returned to the open method. 3; The open method returns the pointer to the user. l; The DOA object can now act as an agent for the stored object. Access of the shoe number attribute in the object is done as follows: 2; Shoe number = PersonDOA-> Shoe number 3; The shoe number attribute is represented in the DOA object by a method with the same name. The method calls the DMI operation to read attribute values, with the parameters offset and address bar index. 4; The database manager locates the database record using the address table, and returns the value of the specified attribute. 3; DOA returns the call to the client.

- Uppdatering 1; Antag att vi har objekttypen Person i databasen, och att en transaktion har startats. Att uppdatera ett objekt går till på följande sätt: 2; Person::openUpdate(, ) // Riktat till genererad klassmetod. (C++ syntax) 501 433 8 3; Klassmetoden anropar DMI-gränssnittets generiska open- metod parametrar: transaktionsID, objekttypsnummer & primär- nyckelvärde, varav objekttypsnumret är inkodat i den genere- rade open-metoden. 4; Databashanteraren lokaliserar aktuellt objekt med hjälp av sökindex.- Update 1; Assume that we have the object type Person in the database, and that a transaction has been started. Updating an item is done as follows: 2; Person :: openUpdate (,) // Aimed at generated class method. (C ++ syntax) 501 433 8 3; The class method calls the DMI interface's generic open method parameters: transaction ID, object type number & primary key value, of which the object type number is encoded in the generated open method. 4; The database manager locates the current object using the search index.

En kopia av databasposten skapas i databashanterarens minnes- rymd.A copy of the database record is created in the database manager's memory space.

Pekare, dvs fysisk minnesadress till kopian läggs in i en tabell, och ett checksummerat index till tabellen returneras till den genererade open-metoden.Pointer, ie the physical memory address of the copy is entered in a table, and a checksum index to the table is returned to the generated open method.

Databasposten innehåller en referens till ett klassobjekt som i sin tur innehåller bl a en pekare till DOA-klassens kon- struktör. Med hjälp av denna skapas ett DOA-objekt av faktisk klass, i användarprocessens minnesarea.The database entry contains a reference to a class object which in turn contains, among other things, a pointer to the DOA class constructor. With the help of this, a DOA object of actual class is created, in the memory area of the user process.

I DOA-objektet lagras det checksummerade indexet till adress- tabellen.In the DOA object, the checksum index is stored to the address table.

Pekaren till DOA-objektet returneras till open-metoden. 3; Open-metoden returnerar pekaren till klienten. 1; DOA-objektet kan nu fungera som en agent för det lagrade objektet. Tilldelning av ett värde för attributet skonummer i objektet går till på följande sätt: 2; PersonDOA->Skonummer-put(47) 3; Attributet skonummer representeras i DOA-objektet av en metod med samma namn. Metoden anropar DMI-operationen för att uppdatera attributvärden, med parametrarna attributnummer och I adresstabell-index. 4; Databashanteraren lokaliserar uppdateringskopian med hjälp av adresstabellen, och tilldelar värdet till angivet attri- 501 433 but. 3; DOA returnerar anropet till användaren. 1; För att uppdatering skall bli persistent, och synlig för andra processer, måste transaktionen den ingår i "commitas". Det går till ungefär så här: 2; trRef->commit 4; Transaktionshanteraren förbereder commit genom att skriva i loggar mm. samt utföra ett 2PC-protokoll om transaktionen är fördelad på flera processorer. Därefter växlas kopior och original, så att uppdaterade objekt blir synliga.The pointer to the DOA object is returned to the open method. 3; The open method returns the pointer to the client. 1; The DOA object can now act as an agent for the stored object. Assignment of a value for the shoe number attribute in the object is done as follows: 2; PersonDOA-> Shoe number-put (47) 3; The shoe number attribute is represented in the DOA object by a method with the same name. The method calls the DMI operation to update attribute values, with the parameters attribute number and I address table index. 4; The database manager locates the update copy using the address table, and assigns the value to the specified attribute. 3; DOA returns the call to the user. 1; In order for an update to be persistent, and visible to other processes, the transaction it is part of must be "committed". It goes something like this: 2; trRef-> commit 4; The transaction manager prepares commit by writing in logs etc. and perform a 2PC protocol if the transaction is distributed across multiple processors. Copies and originals are then exchanged so that updated objects are visible.

Transaktionshanteraren exekverar post-commit triggers i DOA:n för alla objekten som ingår i transaktionen. 3; Trigger-metoden tillhör DOA:n. 4; Transaktionshanteraren släpper låsen och tar bort DOA- objekten.The transaction manager executes post-commit triggers in the DOA for all objects included in the transaction. 3; The trigger method belongs to the DOA. 4; The transaction manager releases the locks and removes the DOA objects.

Retur till klienten.Return to the client.

-Instansiering 2; Person::create(, ) // Riktat till genererad klassmetod.(C++ syntax) 3; Klassmetoden anropar DMI-gränssnittets generiska open- metod parametrar: transaktionsID, objekttypsnummer & primär- nyckelvärde, varav objekttypsnumret är inkodat i den genere- rade open-metoden. 4; Databashanteraren reserverar objektets primärnyckelvärde.-Installation 2; Person :: create (,) // Aimed at generated class method. (C ++ syntax) 3; The class method calls the DMI interface's generic open method parameters: transaction ID, object type number & primary key value, of which the object type number is encoded in the generated open method. 4; The database manager reserves the object's primary key value.

En databaspost skapas i databashanterarens minnesrymnd, men 501 433 10 den knyts inte till Pekare, dvs fysisk minnesadress till kopian läggs in i en tabell, och ett checksummerat index till tabellen returneras till den genererade open-metoden.A database record is created in the database manager's memory space, but it is not linked to Pointer, ie the physical memory address of the copy is entered into a table, and a checksum index to the table is returned to the generated open method.

Databasposten innehåller en referens till ett klassobjekt som i sin tur innehåller bl a en pekare till DOA-klassens kon- - struktör. Med hjälp av denna skapas ett DOA-objekt av faktisk klass, i användarprocessens minnesarea.The database entry contains a reference to a class object which in turn contains, among other things, a pointer to the DOA class constructor. With the help of this, a DOA object of actual class is created, in the memory area of the user process.

I DOA-objektet lagras det checksummerade indexet till adress- tabellen.In the DOA object, the checksum index is stored to the address table.

Pekaren till DOA-objektet returneras till open-metoden. 3; Open-metoden returnerar pekaren till klienten. 1; DOA-objektet kan nu fungera som en agent för det lagrade objektet. Tilldelning av ett värde för attributet skonummer i objektet går till på följande sätt: 2; PersonDOA->Skonummer-put(47) 3; Attributet skonummer representeras i DOA-objektet av en metod med samma namn. Metoden-anropar DMI-operationen för att uppdatera attributvärden, med parametrarna attributnummer och adresstabell-index. 4; Storage manager lokaliserar uppdateringskopian med hjälp av adresstabellen, och tilldelar värdet till angivet attri- but. 3; DOA returnerar anropet till klienten. 1; För att uppdateringen skall bli persistent, och synlig för andra processer, måste transaktionen den ingår i “commitas". Det går till på samma sätt som beskrivits för uppdatering av objekt.The pointer to the DOA object is returned to the open method. 3; The open method returns the pointer to the client. 1; The DOA object can now act as an agent for the stored object. Assignment of a value for the shoe number attribute in the object is done as follows: 2; PersonDOA-> Shoe number-put (47) 3; The shoe number attribute is represented in the DOA object by a method with the same name. The method calls the DMI operation to update attribute values, with the parameters attribute number and address table index. 4; The storage manager locates the update copy using the address table, and assigns the value to the specified attribute. 3; DOA returns the call to the client. 1; In order for the update to be persistent, and visible to other processes, the transaction it is part of must be “committed”.

I det följande skall nu en beskrivning av stödsystemfunktio- ner ges.In the following, a description of support system functions will now be given.

Med hänvisning till fig. 3 genereras koden för agentobjekten från en objekttypsbeskrivning 24 i ett speciellt datadefini- 501 433 ll tionsspråk. En kompilator 26 för detta språk genererar också en beskrivning av datapostens struktur, som databashanteraren 4 använder för att hantera objektets data. Datastrukturbeskriv- ningen och DOA-koden förpackas i en laddmodul som kan laddas in i systemet. Nedan skall ovannämnda kodgenereringen beskrivas närmare.Referring to Fig. 3, the code for the agent objects is generated from an object type description 24 in a special data definition language. A compiler 26 for this language also generates a description of the structure of the data record, which the database manager 4 uses to handle the data of the object. The data structure description and the DOA code are packaged in a charging module that can be loaded into the system. The above code generation will be described in more detail below.

Såsom framgått av ovanstående hanteras lagrade objekt som en datapost i databashanteraren 4 och representeras av ett agent- objekt 16 gentemot användaren. Detta förutsätter att databashan- teraren 4 känner till objektets struktur, dvs dess lagrade attribut, och att agentobjektet kan identifiera för databashan- teraren vilka attribut den vill accessa. Detta möjliggörs med nämnda datadefinitionsspråk med kompilator.As stated above, stored objects are handled as a data record in the database manager 4 and are represented by an agent object 16 to the user. This presupposes that the database manager 4 knows the structure of the object, ie its stored attributes, and that the agent object can identify to the database manager which attributes it wants to access. This is made possible with the said data definition language with compiler.

Med hjälp av datadefinitionsspråket kan man skriva en formell specifikation av en objekttyp. Utifrån denna specifikation genereras dels en datastrukturbeskrivning som kan laddas, pil 28, in i databashanteraren 4, dels koden för agentobjektet 16, pil 30. I den genererade koden ingår anrop till DMI-gränssnittet 12, där objektets attribut identifieras med attributnummer. I det genererade DOI-gränssnittet 22 identifieras samma attribut i klartext med det attributnamn som användes i deklarationen.Using the data definition language, you can write a formal specification of an object type. Based on this specification, a data structure description can be loaded, arrow 28, into the database manager 4, and the code for the agent object 16, arrow 30. The generated code includes calls to the DMI interface 12, where the object's attributes are identified by attribute numbers. In the generated DOI interface 22, the same attribute is identified in plain text by the attribute name used in the declaration.

När ett attribut deklareras i datadefinitionsspråket anges dess namn och typ. I den genererade koden återfinns attributet som två funktioner, en för läsning och en för skrivning, med samma namn som det deklarerade attributet, och som returnerar respektive accepterar värden av samma typ som attributets dekla- rerade typ. I datastrukturbeskrivningen som laddas i databashan- teraren 4 representeras samma attribut av ett attributnummer och en storleksuppgift som motsvarar den deklarerade typens lag- ringsutrymme.When an attribute is declared in the data definition language, its name and type are specified. In the generated code, the attribute is found as two functions, one for reading and one for writing, with the same name as the declared attribute, and which return and accept values of the same type as the declared type of the attribute, respectively. In the data structure description loaded in the database manager 4, the same attribute is represented by an attribute number and a size information that corresponds to the declared space of the declared type.

Uppfinningen ger prestandafördelar, i synnerhet vid läsacces- ser och vid uppdateringar som berör en mindre del av ett objekt.The invention provides performance advantages, in particular for read accesses and for updates that affect a smaller part of an object.

Kort svarstid uppträder vid öppning, och ingen återkopiering till databasen behövs efter en uppdatering, utan objektet finns hela tiden i databasen.Short response time occurs when opening, and no feedback to the database is needed after an update, but the object is always in the database.

Genom att alla skrivoperationer görs via gränssnittet 12 till databashanteraren 4 och inte genom att låta tillämpningskod skriva direkt i databasminnet erhålles skydd mot att tillämp- ningen oavsiktligt skriver sönder andra objekt än de som för |__ ,- 'xm- - 501 433 12 tillfället accessas.By all writing operations are performed via the interface 12 to the database manager 4 and not by having the application code written directly in the database memory, protection is obtained against the application inadvertently writing objects other than those currently accessed | __, - 'xm- - 501 433 12 .

Lösningen möjliggör också en del extra funktioner som hade varit svåra att realisera på annat sätt: - Triggers.The solution also enables some extra functions that would have been difficult to realize in other ways: - Triggers.

Eftersom alla skrivningar i databasen görs genom agentobjektets 16 gränssnitt 22 kan objekttyper och attribut förses med trig- - gers. Triggern realiseras genom att DOI-operationen förutom att göra ett DMI-anrop, dvs anrop via gränssnittet 12, också exekve- rar triggerkoden, som är en del av agentobjektet 16.Since all entries in the database are made through the agent object 16's interface 22, object types and attributes can be provided with triggers. The trigger is realized by the DOI operation in addition to making a DMI call, ie calls via the interface 12, also executing the trigger code, which is part of the agent object 16.

- MOSI-gränssnitt.- MOSI interface.

För samarbete med ett generellt verktyg för användargränssnitt förses objekten med ett gränssnitt som kallas MOSI (Managed Object Support Interface). Detta är ett parametriserat gräns- snitt för access till attribut och exekvering av metoder i objektet, drivet från en generell objekthanteraragent. Metoderna i MOSI-gränssnittet utgör en mappning från externa identiteter till interna, och genereras av kompilatorn 26.For collaboration with a general user interface tool, the objects are provided with an interface called MOSI (Managed Object Support Interface). This is a parameterized interface for accessing attributes and executing methods in the object, powered by a general object handler agent. The methods in the MOSI interface constitute a mapping from external identities to internal ones, and are generated by the compiler 26.

Claims (11)

501 433 13 Patentkrav.501 433 13 Patent claims. 1. Sätt att uppnå dataaccess i en primärminnesbaserad data- bas, kännetecknat av att då ett objekt (18) i databasen (2) accessas av en användare, skapas i användareprocessen (14) ett agentobjekt (16), som innehåller en referens (20) till det riktiga objektet (18), och som uppträder som om det var det riktiga objektet, varvid alla accesser till objektets (18) data sker genom att via referensen (20) i agentobjektet läsa direkt i databashanterarens (4) minne, och varvid dataaccesserna görs via ett generiskt gränssnitt (12), i form av läs- och skrivoperatio- ner mot attribut.Method of achieving data access in a primary memory-based database, characterized in that when an object (18) in the database (2) is accessed by a user, an agent object (16) is created in the user process (14), which contains a reference (20 ) to the real object (18), and which appears as if it were the real object, all accesses to the data of the object (18) taking place by reading directly into the memory of the database manager (4) via the reference (20) in the agent object, and wherein the data accesses are done via a generic interface (12), in the form of read and write operations against attributes. 2. Sätt enligt krav 1, kännetecknat av att all access av data sker genom att ett objekt (18) i databasen (2) öppnas, varvid användaren (14) som resultat av öppningsoperationen tilldelas en pekare (15) till agentobjektet (16), som har det verkliga objek- tets gränssnitt, såsom det har deklarèrats i en objekttypbe- skrivning.Method according to claim 1, characterized in that all access of data takes place by opening an object (18) in the database (2), the user (14) being assigned a pointer (15) to the agent object (16) as a result of the opening operation, which has the interface of the real object, as it has been declared in an object type description. 3. Sätt enligt krav 2, kännetecknat av referensen till databasposten (18) är en pekare (20), som är realiserad på ett sätt som möjliggör kontroll av att referensen är giltig.Method according to claim 2, characterized by the reference to the database record (18) is a pointer (20), which is realized in a way that enables checking that the reference is valid. 4. Sätt enligt något av föregående krav, kännetecknat av att koden för objektets metoder nås via en dynamisk länkningsmeka- nism, som medger att en användare (14) som öppnar ett lagrat objekt (18) inte behöver ha koden för det öppnade objektets klass inlänkad i samma laddmodul, vilken länkning sker i samband med att agentobjektet (16) skapas.Method according to one of the preceding claims, characterized in that the code for the object's methods is accessed via a dynamic linking mechanism, which allows a user (14) who opens a stored object (18) not to have the code for the class of the opened object linked in. in the same charging module, which linking takes place in connection with the creation of the agent object (16). 5. Sätt enligt något av föregående krav, kännetecknat av att agentobjektet (16) kan läsa objektets data direkt från data- bashanterarens (4) minnesarea.Method according to one of the preceding claims, characterized in that the agent object (16) can read the object's data directly from the memory area of the database manager (4). 6. Sätt enligt något av föregående krav, kännetecknat av att anropen till databashanteraren (4) innebär övergång till super- visor-mode, i vilken den exekverande koden har möjlighet att skriva i samtliga delar av datorns minne, medan användarpro- cessen (14) endast har tillgång till sin egen privata minnesarea (6).Method according to one of the preceding claims, characterized in that the calls to the database manager (4) involve a transition to supervisor mode, in which the executing code has the possibility to write in all parts of the computer's memory, while the user process (14) only has access to its own private memory area (6). 7. Sätt enligt något av föregående krav, kännetecknat av att från en objekttypsbeskrivning (24) i ett datadefinitionsspråk genereras koden för agentobjekten (16) och en beskrivning av databaspostens struktur, vilken beskrivning databashanteraren 501 433 14 (4) använder för att hantera objektets data.Method according to one of the preceding claims, characterized in that from an object type description (24) in a data definition language, the code for the agent objects (16) and a description of the database record structure is generated, which description the database manager 501 433 14 (4) uses to handle the object data . 8. Sätt enligt krav 7, kännetecknat av att databashanteraren (4) känner till databasobjektets (18) struktur, dvs dess lagrade attribut, och att agentobjektet (16) kan identifiera för data- bashanteraren (4) vilka attribut den vill accessa.Method according to claim 7, characterized in that the database manager (4) knows the structure of the database object (18), ie its stored attributes, and that the agent object (16) can identify to the database manager (4) which attributes it wants to access. 9. Sätt enligt krav 7, kännetecknat av att i den genererade koden ingår anrop till det generiska gränssnittet (12), där objektets attribut identifieras med attributnummer, varvid i agentobjektets (16) genererade gränssnitt (22) identifieras samma attribut i klartext med det attributnamn som användes i objekttypbeskrivningen.Method according to claim 7, characterized in that the generated code includes calls to the generic interface (12), where the object's attributes are identified by attribute numbers, wherein in the agent object (16) generated interface the same attributes are identified in plain text with that attribute name used in the object type description. 10. Sätt enligt krav 9, kännetecknat av att när ett attribut deklareras i datadefinitionsspråket anges dess namn och typ, varvid i den genererade koden återfinns attributet som två funktioner, en för läsning och en för skrivning, med samma namn som det deklarerade attributet, och som returnerar respektive accepterar värden av samma typ som attributets deklarerade typ.Method according to claim 9, characterized in that when an attribute is declared in the data definition language, its name and type are stated, wherein in the generated code the attribute is found as two functions, one for reading and one for writing, with the same name as the declared attribute, and which returns or accepts values of the same type as the declared type of the attribute. 11. Sätt enligt krav 10, kännetecknat av att i beskrivningen av databaspostens struktur, som laddas (28) i databashanteraren, representeras samma attribut av ett attributnummer och en stor- leksuppgift som motsvarar den deklarerade typens lagringsutrym- me.Method according to claim 10, characterized in that in the description of the structure of the database record, which is loaded (28) into the database manager, the same attribute is represented by an attribute number and a size information corresponding to the declared space of the declared type.
SE9302175A 1993-06-23 1993-06-23 Ways to obtain data access in a primary memory-based database SE501433C2 (en)

Priority Applications (11)

Application Number Priority Date Filing Date Title
SE9302175A SE501433C2 (en) 1993-06-23 1993-06-23 Ways to obtain data access in a primary memory-based database
EP94919941A EP0705460A1 (en) 1993-06-23 1994-06-17 A method of attaining data access in a primary memory based database
BR9406910-7A BR9406910A (en) 1993-06-23 1994-06-17 Method of Gaining Data Access to Data from a Primary Memory-Based Database
PCT/SE1994/000600 WO1995000907A1 (en) 1993-06-23 1994-06-17 A method of attaining data access in a primary memory based database
JP7502716A JPH08512151A (en) 1993-06-23 1994-06-17 Data access method for primary storage system database
KR1019950705890A KR960703251A (en) 1993-06-23 1994-06-17 A METHOD OF ATTAINING DATA ACCESS IN A PRIMARY MEMORY BASED DATABASE
CA002165774A CA2165774A1 (en) 1993-06-23 1994-06-17 A method of attaining data access in a primary memory based database
CN94192575A CN1125991A (en) 1993-06-23 1994-06-17 A method of attaining data access in a primary memory based database
AU70888/94A AU7088894A (en) 1993-06-23 1994-06-17 A method of attaining data access in a primary memory based database
NO955276A NO955276L (en) 1993-06-23 1995-12-22 Process of data accessing in a primary storage-based database
FI956243A FI956243A (en) 1993-06-23 1995-12-22 A method for implementing data access in a database based on primary memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
SE9302175A SE501433C2 (en) 1993-06-23 1993-06-23 Ways to obtain data access in a primary memory-based database

Publications (3)

Publication Number Publication Date
SE9302175D0 SE9302175D0 (en) 1993-06-23
SE9302175L SE9302175L (en) 1994-12-24
SE501433C2 true SE501433C2 (en) 1995-02-13

Family

ID=20390394

Family Applications (1)

Application Number Title Priority Date Filing Date
SE9302175A SE501433C2 (en) 1993-06-23 1993-06-23 Ways to obtain data access in a primary memory-based database

Country Status (11)

Country Link
EP (1) EP0705460A1 (en)
JP (1) JPH08512151A (en)
KR (1) KR960703251A (en)
CN (1) CN1125991A (en)
AU (1) AU7088894A (en)
BR (1) BR9406910A (en)
CA (1) CA2165774A1 (en)
FI (1) FI956243A (en)
NO (1) NO955276L (en)
SE (1) SE501433C2 (en)
WO (1) WO1995000907A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5864864A (en) * 1995-09-27 1999-01-26 Sun Microsystems, Inc. Method and apparatus for providing transparent persistent data support to foreign data types
US6085178A (en) * 1997-03-21 2000-07-04 International Business Machines Corporation Apparatus and method for communicating between an intelligent agent and client computer process using disguised messages
US6401080B1 (en) 1997-03-21 2002-06-04 International Business Machines Corporation Intelligent agent with negotiation capability and method of negotiation therewith
US6192354B1 (en) 1997-03-21 2001-02-20 International Business Machines Corporation Apparatus and method for optimizing the performance of computer tasks using multiple intelligent agents having varied degrees of domain knowledge
US6510429B1 (en) * 1998-04-29 2003-01-21 International Business Machines Corporation Message broker apparatus, method and computer program product
GB2408355B (en) * 2003-11-18 2007-02-14 Ibm A system for verifying a state of an environment
CN100461176C (en) * 2006-01-26 2009-02-11 无锡永中科技有限公司 Object memory store based object reference method
CN101410836B (en) * 2006-06-08 2012-05-30 国际商业机器公司 A method for providing access to data stored in a database to an application
CN100403315C (en) * 2006-09-25 2008-07-16 华为技术有限公司 System and method for database access for implementing load sharing
CN105095198B (en) * 2014-04-16 2018-12-04 阿里巴巴集团控股有限公司 A kind of method and device accessing data entity
CN112148650B (en) * 2020-09-30 2022-07-19 Oppo广东移动通信有限公司 Design method, device and equipment of storage controller and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06105435B2 (en) * 1985-10-25 1994-12-21 株式会社日立製作所 Storage management mechanism by information processing device
US5297279A (en) * 1990-05-30 1994-03-22 Texas Instruments Incorporated System and method for database management supporting object-oriented programming
US5235701A (en) * 1990-08-28 1993-08-10 Teknekron Communications Systems, Inc. Method of generating and accessing a database independent of its structure and syntax
US5291593A (en) * 1990-10-24 1994-03-01 International Business Machines Corp. System for persistent and delayed allocation object reference in an object oriented environment
US5212787A (en) * 1991-03-12 1993-05-18 International Business Machines Corporation Method and apparatus for accessing a relational database without exiting an object-oriented environment

Also Published As

Publication number Publication date
NO955276D0 (en) 1995-12-22
CA2165774A1 (en) 1995-01-05
BR9406910A (en) 2003-07-08
SE9302175L (en) 1994-12-24
KR960703251A (en) 1996-06-19
JPH08512151A (en) 1996-12-17
FI956243A0 (en) 1995-12-22
AU7088894A (en) 1995-01-17
FI956243A (en) 1995-12-22
NO955276L (en) 1996-02-23
WO1995000907A1 (en) 1995-01-05
SE9302175D0 (en) 1993-06-23
CN1125991A (en) 1996-07-03
EP0705460A1 (en) 1996-04-10

Similar Documents

Publication Publication Date Title
Atkinson et al. An approach to persistent programming
US6240413B1 (en) Fine-grained consistency mechanism for optimistic concurrency control using lock groups
EP0620522B1 (en) High performance dynamic linking through caching
Schroeder et al. A caching file system for a programmer's workstation
US20080320282A1 (en) Method And Systems For Providing Transaction Support For Executable Program Components
Jones et al. A language extension for expressing constraints on data access
US6154747A (en) Hash table implementation of an object repository
US4481577A (en) Method of operating a computer system to provide customized responses
US5748952A (en) System and method for avoiding complete index tree traversals in sequential and almost sequential index probes
JP2010509678A (en) Virtual delete in merged registry key
SE501433C2 (en) Ways to obtain data access in a primary memory-based database
Baroody Jr et al. An object-oriented approach to database system implementation
US5842223A (en) Method and apparatus for information state management
Connor Types and polymorphism in persistent programming systems
WO2007118168A2 (en) Generating a user interface using a domain specific language
Coughlin et al. Compositional reasoning for non-multicopy atomic architectures
US7127675B1 (en) Method and system for automatically revising software help documentation
Ridley An expert system for quality control and duplicate detection in bibliographic databases
Morrison et al. The persistent store as an enabling technology for integrated project support environments
Boyapati JPS: A distributed persistent Java system
McNally Models for Persistence in Lazy Functional Programming Systems
Berman P-Pascal: A data-oriented persistent programming language
US20070198580A1 (en) Method for indirect representation and access in an object-oriented programming language
Hughes Checking spelling in source code
Moss Persistent Owl: Heap Management and Integration with Mneme