Does anybody have a more detailed guide or code examples on using Magma than what is on the main Squeak Swiki? I am running into problems, at a very eary stage, and I am almost sure that these problems are caused because of my meager knowledge on how to use the framework. For example, all the collections held as attributes by classes that you intend to persist should be MagmaCollections? How does the fact of using Magma affect the code and development process? What are the most important things to keep in mind?
I had problems with Magma too. I switched to goods OO database and it's really working without any problems. You just read some examples and you can start using it. You can download it here: http://www.garret.ru/~knizhnik/goods.html The squeak package is on the SqueakMap, and more information is here: http://minnow.cc.gatech.edu/squeak/3492
regards marco
Am Mittwoch, 30. Juni 2004 16:53 schrieb Ramiro Diaz Trepat:
Does anybody have a more detailed guide or code examples on using Magma than what is on the main Squeak Swiki? I am running into problems, at a very eary stage, and I am almost sure that these problems are caused because of my meager knowledge on how to use the framework. For example, all the collections held as attributes by classes that you intend to persist should be MagmaCollections? How does the fact of using Magma affect the code and development process? What are the most important things to keep in mind?
Hi!
Marco Paga seaside@marco-paga.de wrote:
I had problems with Magma too. I switched to goods OO database and it's really working without any problems. You just read some examples and you can start using it.
Nothing wrong with GOODs of course, I played with it a bit and Jonas here is actually migrating a Hibernate app over to GOODs - will be very interesting to see the results, especially compared to Hibernate which people are so excessively worked up about. ;)
But I have also used Magma, and I have had almost no problems.
Am Mittwoch, 30. Juni 2004 16:53 schrieb Ramiro Diaz Trepat:
Does anybody have a more detailed guide or code examples on using Magma than what is on the main Squeak Swiki?
Eh, no. :) But I am making a demo app that uses Magma. Though I am not sure when it will be ready for "consumption".
I am running into problems, at a very eary stage, and I am almost sure that these problems are caused because of my meager knowledge on how to use the framework. For example, all the collections held as attributes by classes that you intend to persist should be MagmaCollections?
No, that is not needed. You can use MagmaCollections if you want the features they give though. I haven't used them yet.
How does the fact of using Magma affect the code and development process? What are the most important things to keep in mind?
Well, since I haven't done a lot with Magma yet - but I do have some experience with OOdbs in general. Object migration is likely the most "tricky" part. Which means the problem of migrating you old objects over to new evolved classes. I haven't seen exactly what limitations Magma has in that respect - though I think it can handle some cases.
A general technique that might be useful though is if you have an import/export format of some kind that will not evolve. One system I built needed XML import/export for a large sub part of the domain model. We used that feature to be able to "reload" test data into an empty db during development.
So in short - having a test db that can be recreated from either external files of from "instantiation code" can be a real time saver during development. Then the problem of object migration will not rear its ugly head until after the first deployment. :)
Note: The above technique is not specific for OOdbs, IMHO it applies equally well to any system with persistent data.
Finally - the development process with Magma is IMHO more or less like pretending you are only working in RAM. :) You just sprinkle your application code (NOT your domain model) with some suitable begin/commits.
regards, Göran
Am Donnerstag, 1. Juli 2004 08:24 schrieb goran.krampe@bluefish.se:
Hi. I'm one of those guys who try to bring something in the image. If it doesn't work "out of the box" I search around the web and then try to find another way to handle it. In most cases I switch to another project and give it a try. I had several problems with Magma I could not explain. Starting and stopping the image took nearly 20 seconds. After restarting some data was lost and I could not figure out why. So in fact I don't want to make anybody use goods. I can just give a quick tip what might be an interesting project.
regards marco
Hi!
Marco Paga seaside@marco-paga.de wrote:
I had problems with Magma too. I switched to goods OO database and it's really working without any problems. You just read some examples and you can start using it.
Nothing wrong with GOODs of course, I played with it a bit and Jonas here is actually migrating a Hibernate app over to GOODs - will be very interesting to see the results, especially compared to Hibernate which people are so excessively worked up about. ;)
But I have also used Magma, and I have had almost no problems.
Thank you very much guys. Marco, I know GOODS is an excellent oodb, it's been used in my company with great success (in a C++ comertial project). Since I am coding squeak mostly for fun, I wanted to try the *pure* squeak way, and hence I wanted to give Magma a fair chance. Besides, I have an "irrational" belief in it (by now at least), and respect for the impressive undertaking that Chris Müller faced. So before I give up on it, I want to test it more thoroughly and hear more oppinons of people using it, there must be more out there...
So... another important question: Does Magma support bidirectional relations? I have a very simple situation where it all hangs. Is a very simple line, that commits a class which holds a collection of elements that also have a reference to the main class. Its so simple that I can't find any other explanation. Thanks again.
r.
Hello... where is the usual crowd of this list? I am attaching the "primitive failed" bug that I get, just in case it rings a bell to anyone. bye bye
r.
Ramiro Diaz Trepat wrote:
Thank you very much guys. Marco, I know GOODS is an excellent oodb, it's been used in my company with great success (in a C++ comertial project). Since I am coding squeak mostly for fun, I wanted to try the *pure* squeak way, and hence I wanted to give Magma a fair chance. Besides, I have an "irrational" belief in it (by now at least), and respect for the impressive undertaking that Chris Müller faced. So before I give up on it, I want to test it more thoroughly and hear more oppinons of people using it, there must be more out there...
So... another important question: Does Magma support bidirectional relations? I have a very simple situation where it all hangs. Is a very simple line, that commits a class which holds a collection of elements that also have a reference to the main class. Its so simple that I can't find any other explanation. Thanks again.
r.
Error: a primitive has failed 2 July 2004 12:41:19 am
VM: Win32 - a SmalltalkImage Image: Squeak3.7beta [latest update: #5967]
SecurityManager state: Restricted: false FileAccess: true SocketAccess: true Working Dir D:\Squeak\3.6 Trusted Dir D:\Squeak\3.6\Ramiro Diaz Trepat Untrusted Dir C:\My Squeak\Ramiro Diaz Trepat
Array(Object)>>error: Receiver: <<error during printing>> Arguments and temporary variables: aString: 'a primitive has failed' Receiver's instance variables: <<error during printing>> Array(Object)>>primitiveFailed Receiver: <<error during printing>> Arguments and temporary variables:
Receiver's instance variables: <<error during printing>> Array>>elementsForwardIdentityTo:copyHash: Receiver: <<error during printing>> Arguments and temporary variables: otherArray: #(an OrderedCollection(2066649)) copyHash: false Receiver's instance variables: <<error during printing>> MaOdbmsProxy(MaMutatingProxy)>>becomeForward:copyHash: Receiver: <<error during printing>> Arguments and temporary variables: otherObject: an OrderedCollection(2066649) copyHash: false Receiver's instance variables: <<error during printing>>
--- The full stack --- Array(Object)>>error: Array(Object)>>primitiveFailed Array>>elementsForwardIdentityTo:copyHash: MaOdbmsProxy(MaMutatingProxy)>>becomeForward:copyHash: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MaObjectSerializer>>newSkeletonFor:fromProxy: [] in MaObjectSerializer>>materializeGraphDo: {[:foundObj | foundObj maIsBufferedObjectProxy ifTrue: [skeletons add:...]} [] in MagmaOidManager>>objectWithOid:ifFound:ifAbsent: {[:obj | obj ifNil: [aBlock value] ifNotNil: [oneArgBlock value: obj]]} MaWeakValueDictionary(MaDictionary)>>maAt:ifPresent:ifAbsent: [] in MagmaOidManager>>objectWithOid:ifFound:ifAbsent: {[(MaOidCalculator isOidForNewObject: anInteger) ifTrue: [newObjects ma...]} MaOidCalculator class>>objectWithOid:ifNone: MagmaOidManager>>objectWithOid:ifFound:ifAbsent: MaObjectSerializer>>objectWithOid:ifFound:ifAbsent: [] in MaObjectSerializer>>materializeGraphDo: {[:each | object := self objectWithOid: each oid ifFound: [:foundObj...]} [] in MaSerializedGraphBuffer>>buffersDo: {[:eachPosition | buffer := preMadeBuffers at: (self bufferTypeAt: eachP...]} MaSerializedGraphBuffer>>bufferPositionsDo: MaSerializedGraphBuffer>>buffersDo: MaObjectSerializer>>materializeGraphDo: MaObjectSerializer>>materializeGraph:do: MagmaSession>>materializeObject: MagmaSession>>realObjectFor: MaOdbmsProxy>>mutant MaOdbmsProxy(MaMutatingProxy)>>mutateAndSend: MaOdbmsProxy(MaMutatingProxy)>>doesNotUnderstand: #size [] in MagmaClassIdManager>>materializeAllClassDefinitions {[:each | each size]} [] in Dictionary>>do: {[:assoc | aBlock value: assoc value]} Dictionary(Set)>>do: Dictionary>>do: MagmaClassIdManager>>materializeAllClassDefinitions MaObjectSerializer>>materializeAllClassDefinitions MagmaSession>>refreshViewUsing: MagmaSession>>refresh MagmaSession>>abort MagmaRepositoryController>>refreshView MaObjectRepository>>submitAll:for:beginAnother: MagmaRepositoryController>>submitAll:for:beginAnother: MaWriteRequest>>process [] in MagmaRepositoryController>>processRequest: {[aMaRepositoryRequest process]} [] in Semaphore>>critical: {[blockValue := mutuallyExcludedBlock value]} BlockContext>>ensure: Semaphore>>critical: MagmaRepositoryController>>requestCritical: [] in MagmaRepositoryController>>processRequest: {[aMaRepositoryRequest sessionId = self sessionId ifTrue: [aMaRepositoryReq...]} BlockContext>>on:do: MagmaRepositoryController>>processRequest: [] in MagmaSession class>>repositoryController: {[:eachRequest | aMaRepositoryController processRequest: eachRequest]} [] in MaLocalRequestServer(MaRequestServer)>>processRequest: {[processBlock value: aMaServerRequest]} BlockContext>>on:do: MaLocalRequestServer(MaRequestServer)>>processRequest: MaLocalServerLink>>submit: MaRepositoryControllerFacade>>submit: MaRepositoryControllerFacade>>submitAll:andBegin: [] in MagmaSession>>commitAndBegin: {[anchor := nil. facade submitAll: commitPackage andBegin: aBoolean]} BlockContext>>on:do: MagmaSession>>commitAndBegin: MagmaSession>>commit [] in MagmaSession>>commit: {[result := aBlock value. self commit]} BlockContext>>ensure: MagmaSession>>commit: ...etc...
squeak-dev@lists.squeakfoundation.org