Mochiweb mnesia requests

I am trying to link Mochiweb with my ejabberd mnesia db and cannot execute mnesia transactions in my controllers. I am testing my controllers without mnesia transactions and they are working fine. I am using app: start (mnesia) inside a start function.

In the browser I see "Internal Server Error" and in the Mochiweb log I see: "= ERROR REPORT === function_clause". I would like to know how to either 1.) get mnesia to work with Mochiweb or 2.) what is a nice framework that I could connect to ejabberd's webserver.

Thank!

+2


source to share


3 answers


You know, I think I was doing it all wrong ... I thought it would work for both PHP / SQL and Rails / SQL, but it seems the best way to do it is to call 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 "restore" some of my tables - basically erase everything.



If anyone has any data on this (or if I am completely disconnected) please let me know. Thank!

0


source


Do you have the rest of the error message from the Mochiweb log - the bit after "function_clause", if any?



+1


source


There must be an error in your code. Last time I checked the mochiweb source it wrapped your "loop" function in a try catch. If he caught an exception, he printed the type of that exception in the error log; in your case you have a function_clause exception.

Try calling the loop function manually, or wrap your code with another catch attempt to be able to see the entire exception. If you cannot decipher it, please insert it into your question.

0


source







All Articles