[elephant-devel] Just a clarification on using elephant metaclasses and problem accessing OID

Waldo Rubinstein waldo at trianet.net
Fri Jan 6 18:20:23 UTC 2006


Hi all,

In playing with CLOS and using the :metadata class option to use  
elephant, I realized that you cannot instantiate a CLOS object that  
uses the :metadata option without first opening an elephant store.

See below:

Welcome to OpenMCL Version 1.0 (DarwinPPC32)!
? (load "lisp/dev/edi.lisp")
;Compiler warnings :
;   Undefined function :STORE-CONTROLLER-SQL (2 references), in MAKE- 
OR-FIND-834-TAPE.
;   Undefined function ELEPHANT::WITH-TRANSACTION-SQL (2 references),  
in MAKE-OR-FIND-834-TAPE.
#P"/Users/waldo/dev/lisp/dev/edi.lisp"
? (setf entry (make-instance 'oonet:edi-entry))
 > Error in process listener(1): No applicable method for args:
 >                                (NIL)
 >                                to #<STANDARD-GENERIC-FUNCTION  
ELEPHANT::NEXT-OID #x8408F0E>
 > While executing: #<CCL::STANDARD-KERNEL-METHOD NO-APPLICABLE- 
METHOD (T)>
 > Type :POP to abort.
Type :? for other options.
1 > :pop

? (ele:open-store "testdb")
#<ELEPHANT:BDB-STORE-CONTROLLER #x8A689D6>
? (setf entry (make-instance 'oonet:edi-entry))
#<COM.OONET.EDI:EDI-ENTRY #x8A66986>
? (ele:close-store)
NIL

The reason I mention this is because it's not clear in the  
documentation that you need to have the store opened.

Now, the problem I have is that I can't access the object's OID value  
as per the documentation. See below:

? (slot-value entry 'oonet::oid)
 > Error in process listener(1): #<COM.OONET.EDI:EDI-ENTRY #x8A66986>  
has no slot named COM.OONET.EDI::OID.
 > While executing: #<CCL::STANDARD-KERNEL-METHOD SLOT-MISSING (T T T  
T)>
 > Type :POP to abort.
Type :? for other options.
1 > :pop

? (slot-value entry 'ele::oid)
 > Error in process listener(1): #<COM.OONET.EDI:EDI-ENTRY #x8A66986>  
has no slot named ELEPHANT::OID.
 > While executing: #<CCL::STANDARD-KERNEL-METHOD SLOT-MISSING (T T T  
T)>
 > Type :POP to abort.
Type :? for other options.
1 > :pop

How can I fetch the OID?

My class is defined roughly as follows:

(defclass edi-entry ()
   (last-name first-name ssn)
   (:metaclass persistent-metaclass))

in

(defpackage :com.oonet.edi
   (:use :common-lisp
	:it.bese.ucw
	:it.bese.yaclml
	:elephant)
   (:nicknames :oonet)
   (:export :edi-entry))

(in-package :com.oonet.edi)

Thanks,
Waldo




More information about the elephant-devel mailing list