Search code examples
erlangejabberdmnesiamochiweb

Mochiweb mnesia requests


I'm trying to link Mochiweb with my ejabberd mnesia db and am unable to do any mnesia transactions in my controllers. I test my controllers without the mnesia transactions and they work fine. I am using application:start(mnesia) inside the start function.

On the browser, I see "Internal server error" and on Mochiweb's log I see, "=ERROR REPORT=== function_clause". I'd like to know how to either 1.) get mnesia to work with Mochiweb or 2.) what a good framework I could plugin to ejabberd's web server is.

Thanks!


Solution

  • You know, I think I was doing it all wrong... I was thinking it would work like PHP/SQL and Rails/SQL, but it seems the best way to do this is calling methods from the Mochiweb node to the ejabberd node.

    Also I noticed that when I started Mochiweb connected to the same mnesia database as ejabberd, it tried to "repair" some of my tables - basically erasing everything.

    If anyone has any input on this (or if I'm totally off) please let me know. Thanks!