Wednesday, February 24, 2010

Magma, an object oriented database

This "Getting started with Magma" screncast shows:

  • how to create a Magma repository on the filesystem to store objects
  • run Magma server in one image
  • connect to the server from two other client images
  • share objects between the clients

Update: I've written an error at 10:23, see Peter's comment.

Download screencast (800x600): .mpeg 26.3 MB, .mov 47.6 MB



Load the source code:
Gofer new
 squeaksource: 'Pharocasts';
 package: 'GettingStartedWithMagma';
 load.

Load Magma into Pharo:
Gofer new
 squeaksource: 'MetacelloRepository';
 package: 'ConfigurationOfMagma';
 load.
 
(Smalltalk at:#ConfigurationOfMagma) 
 project latestVersion 
  load: 'Server'; 
  load: 'Client'.

See also: Magma Squeak wiki page.

Inspirated by Getting started with Magma wiki page.

14 comments:

  1. Great video! Thank you very much.

    Just one question: at 10:23 you start writing the release method. I am not familiar with Magma, yet. But shouldn't it be

    "Default ifNotNil:[ ... ]" instead of "ifNil: [...]"

    Otherwise your further processing doesn't make sense.

    ReplyDelete
  2. Oups ! Yes you're right :) I will try to re-record it.
    Thanks !

    ReplyDelete
  3. HI:

    How can i run the image as a service in linux to run in a server without graphic ?

    ReplyDelete
  4. @Restaurador you can pass the -headless parameter to the vm like this:

    squeak -headless /path/to/my/pharo.image

    ReplyDelete
  5. I want to use the IDE by web running the IDE on a server and in another computer can work with it.
    And too when i will finish the application can have the vm up to load the image of the program

    ReplyDelete
  6. @Restaurador I know you can use VNC to access you image remotely. Seaside includes a builtin browser. SeasideXUL http://code.google.com/p/seasidexul/ is also interesting.

    You should ask Pharo / Seaside mailing lists for more informations

    ReplyDelete
  7. I have problems with (Smalltalk at:#ConfigurationOfMagma)
    project latestVersion
    load: 'Server';
    load: 'Client'.

    always get: MessageNotUnderstood
    on Windows/Pharo 1.0

    ReplyDelete
  8. ... I got it via Monticello and IT'S GREAT !!!

    ReplyDelete
  9. Great sceencast, thanks. I have problems installing magma db in pharo image. I have tried with pharo 1.1, .1.2 and the latest without success. As I have read from other post is current version of magma incompatible with any pharo image (in not maintained for pharo but only for squeak). Is there any possibility to install magma into pharo?

    ReplyDelete
  10. @Bostjan,

    currently Magma is having issues (Chris Muller is fixing them) in Pharo 1.2. One working combination is Magma 1.1r1 on Pharo 1.2.1. Get a PharoCore 1.2.1 and evaluate in a workspace:

    Deprecation raiseWarning: false.
    Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfMagma';
    load.
    ((Smalltalk at: #ConfigurationOfMagma)
    project version: #stable) load: 'Tester'.

    Then create a directory for the repo (magma in this case) and evaluate in a workspace:

    "Create a repository"
    MagmaRepositoryController
    create: 'magma/'
    root: Dictionary new.

    "Start the magma server"
    MagmaServerConsole new
    open: 'magma/';
    processOn: 51969;
    inspect.

    "Connect to magma"
    (MagmaSession host: 'localhost' port: 51969)
    connectAs: 'miguel';
    inspect.

    In the windows raised by the last doit (the connection window) evaluate:

    self root inspect

    and then

    self root at #miguel put: OrderedCollection new

    and then again:

    self root inspect.

    When Magma 1.2 is working on Pharo 1.2 and Pharo 1.3 I will update the ConfigurationOfMagma and announce it on the pharo and magma mailing lists.

    Cheers

    ReplyDelete
  11. Is Magma still alive? Very little activity

    ReplyDelete