Opaque types
First Claim
1. A method of handling within a database system a data item that is associated with a data type whose native structure is not known to said database system, the method comprising the steps of:
- said database system receiving user input that specifies a pickling mechanism and an unpickling mechanism for said data type;
the database system registering a first user-specified routine for pickling data items that belong to said data type;
the database system registering a second user-specified routine for unpickling data items that belong to said data type;
prior to storing said data item to non-volatile memory, said database system invoking the pickling mechanism that has been specified by user input, said pickling mechanism transforming said data item from said native structure to a storable format, wherein the step of invoking the pickling mechanism is performed by invoking the first user-specified routine for pickling data items that belong to said data type;
upon reading said data item from non-volatile memory, said database system invoking the unpickling mechanism that has been specified by user input, said unpickling mechanism transforming said data item from said storable format to said native structure, wherein the step of invoking the unpickling mechanism is performed by invoking the second user-specified routine for unpickling data items that belong to said data type; and
maintaining said data item in said native structure as the data item is passed between said database system and routines that expect said data item to be in said native structure.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus are provided for handling within a database system data items that are associated with data types whose native structure is not known to the database system. The data items are stored within the database system in their native structure, even though it is not understood by the database system. To store the data items, the database system calls a pickling routine that is provided by the user, or by the runtime subsystem of the programming environment that is native to the data item. To retrieve the routine from storage, the database system calls an unpickling routine, also provided by the user or the appropriate runtime subsystem. Because the database maintains the data items in their native format, no conversions are required as the data items are passed between the database system and external routines that manipulate the data items. Techniques are also provided for declaring attributes of the data item that can be accessed within the database system. The user provides routines for the database system to call in order to access the declared attributes, which may be different than the actual attributes that the data item has in its native environment.
16 Citations
22 Claims
-
1. A method of handling within a database system a data item that is associated with a data type whose native structure is not known to said database system, the method comprising the steps of:
-
said database system receiving user input that specifies a pickling mechanism and an unpickling mechanism for said data type;
the database system registering a first user-specified routine for pickling data items that belong to said data type;
the database system registering a second user-specified routine for unpickling data items that belong to said data type;
prior to storing said data item to non-volatile memory, said database system invoking the pickling mechanism that has been specified by user input, said pickling mechanism transforming said data item from said native structure to a storable format, wherein the step of invoking the pickling mechanism is performed by invoking the first user-specified routine for pickling data items that belong to said data type;
upon reading said data item from non-volatile memory, said database system invoking the unpickling mechanism that has been specified by user input, said unpickling mechanism transforming said data item from said storable format to said native structure, wherein the step of invoking the unpickling mechanism is performed by invoking the second user-specified routine for unpickling data items that belong to said data type; and
maintaining said data item in said native structure as the data item is passed between said database system and routines that expect said data item to be in said native structure. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
the step of invoking the first user-specified routine for pickling data items that belong to said data type is performed by invoking a runtime subsystem for a programming environment associated with the data type; and
the step of invoking the second user-specified routine for unpickling data items that belong to said data type is performed by invoking a runtime subsystem for the programming environment associated with the data type.
-
-
3. The method of claim 1, wherein:
-
the step of invoking the first user-specified routine for pickling data items that belong to said data type is performed by invoking a first user-implemented routine for pickling data items that belong to said data type; and
the step of invoking the second user-specified routine for unpickling data items that belong to said data type is performed by invoking a second user-implemented routine for unpickling data items that belong to said data type.
-
-
4. The method of claim 1 further comprising the step of said database system receiving a type declaration associated with said data type, wherein said type declaration specifies one or more attributes that are of data types that are supported by said database system.
-
5. The method of claim 4 further comprising the steps of:
-
said database system registering a user-specified method associated with a first attribute of said one or more attributes;
said database system invoking said user-specified method to access said first attribute.
-
-
6. The method of claim 5 further comprising the steps of:
-
said database system registering a second user-specified method associated with a second attribute of said one or more attributes;
said database system invoking said second user-specified method to access said second attribute.
-
-
7. The method of claim 4 wherein:
-
said native structure has a plurality of attributes; and
said plurality of attributes do not have a one-to-one correspondence with said one or more attributes specified by said type declaration.
-
-
8. The method of claim 7 wherein said native structure has an attribute that does not correspond to any of said one or more attributes specified by said type declaration.
-
9. The method of claim 7 wherien said native structure does not have any attribute that corresponds to one of said one or more attributes specified by said type declaration.
-
10. A method for handling within a database system a data item that is associated with a data type whose native structure is not known to said database system, the method comprising the steps of:
-
the database system registering a first user-specified routine for pickling data items that belong to said data type;
the database system registering a second user-specified routine for unpickling data items that belong to said data type;
to store data items that belong to said data type on non-volatile memory, invoking said first user-specified routine for pickling data items that belong to said data type; and
to load data items that belong to said data type from non-volatile memory, invoking said second user-specified routine for unpickling data items that belong to said data type;
said database system receiving user input that specifies the set of attributes;
said database system receiving user input that specifies a data type that is supported by said database system for each attribute in said set of attributes;
said database system receiving user input that specifies an external routine for accessing a first attribute of said set of attributes, wherein said external routine expects said data item to have said native structure;
said database system invoking said external routine to access said at least one attribute;
in response to invoking said external routine, said database system receiving from said external routine a value that is structured according to the data type associated with said first attribute.- View Dependent Claims (11, 12, 13)
-
-
14. A computer-readable medium carrying one or more sequences of instructions for handling within a database system a data item that is associated with a data type whose native structure is not known to said database system, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
said database system receiving user input that specifies a pickling mechanism and an unpickling mechanism for said data type;
the database system registering a first user-specified routine for pickling data items that belong to said data type;
the database system registering a second user-specified routine for unpickling data items that belong to said data type;
prior to storing said data item to non-volatile memory, said database system invoking the pickling mechanism that has been specified by user input, said pickling mechanism transforming said data item from said native structure to a storable format, wherein the step of invoking the pickling mechanism is performed by invoking the first user-specified routine for pickling data items that belong to said data type;
upon reading said data item from non-volatile memory, said database system invoking the unpickling mechanism that has been specified by user input, said unpickling mechanism transforming said data item from said storable format to said native structure, wherein the step of invoking the unpickling mechanism is performed by invoking the second user-specified routine for unpickling data items that belong to said data type; and
maintaining said data item in said native structure as the data item is passed between said database system and routines that expect said data item to be in said native structure. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22)
the step of invoking the first user-specified routine for pickling data items that belong to said data type is performed by invoking a runtime subsystem for a programming environment associated with the data type; and
the step of invoking the second user-specified routine for unpickling data items that belong to said data type is performed by invoking a runtime subsystem for the programming environment associated with the data type.
-
-
16. The computer-readable medium of claim 14 wherein:
-
the step of invoking the first user-specified routine for pickling data items that belong to said data type is performed by invoking a first user-implemented routine for pickling data items that belong to said data type; and
the step of invoking the second user-specified routine for unpickling data items that belong to said data type is performed by invoking a second user-implemented routine for unpickling data items that belong to said data type.
-
-
17. The computer-readable medium of claim 14 further comprising instructions for performing the step of said database system receiving a type declaration associated with said data type, wherein said type declaration specifies one or more attributes that are of data types that are supported by said database system.
-
18. The computer-readable medium of claim 17 further comprising sequences of instructions for performing the steps of:
-
said database system registering a user-specified computer-readable medium associated with a first attribute of said one or more attributes;
said database system invoking said user-specified computer-readable medium to access said first attribute.
-
-
19. The computer-readable medium of claim 18 further comprising instructions for performing the steps of:
-
said database system registering a second user-specified computer-readable medium associated with a second attribute of said one or more attributes;
said database system invoking said second user-specified computer-readable medium to access said second attribute.
-
-
20. The computer-readable medium of claim 17 wherein:
-
said native structure has a plurality of attributes; and
said plurality of attributes do not have a one-to-one correspondence with said one or more attributes specified by said type declaration.
-
-
21. The computer-readable medium of claim 20 wherein said native structure has an attribute that does not correspond to any of said one or more attributes specified by said type declaration.
-
22. The computer-readable medium of claim 20 whereins aid native structure does not have any attribute that corresponds to one of said one or more attributes specified by said type declaration.
Specification