On 6/12/10 11:39 PM, Chris Muller wrote:
Interesting. Now, you probably noticed already that you have easy-access to a Magma-provided timestamp and commitNumber for each record. Those would seem to be useful for an "audit log".
As far as getting at the objects, it is not difficult. You would just need to open the repository to establish the proper class-map, and then use that serializer to materialize the "objects" instVar of the MaCommitPackage contained within the MaCommitLogRecord.
Its not clear to me from the code how I access the commit package. I see that I can get the byte array from the record method of a MaCommitRecord, but I can't seem to materialize the contents of that array. Is the commit package serialized inside that byte array or is there another way to rebuild it?
I've tried using the same method calls that are used elsewhere in Magma to materialize the contents of the commit record as below:
aMaObjectSerializer resetOidManager materializeGraph: aMaCommitRecord record.
But that doesn't work (see my first e-mail for the error).
Right now when I try to materialize a record in Pharo 1.0, I get an error because the serializer tries to call basicNew: on the MagmaLocalLocation class. I'm not sure if this is even a good path to take, so fell free to tell me I'm crazy or that I shouldn't go there :)
Not sure.. :) Why are you inclined to do this?
Only because a feature requested for my app is "the ability to audit who changed what... just in case." It doesn't need to be an end-user accessible feature, and it won't be used often. Instead of me building something new I realized that Magma has these commit records in the db already... so I'm thinking I can just do something simple like record which commit numbers a user is responsible for and then if I need to I can go back later and extract the needed information from that commit.
Regards, Chris
Thanks again for your help! And for Magma, it is great having an open source database of this quality!