Well folks, I appreciate your help, but I've got the problem solved by re-implementing the chat backend (server) in Rails. It is working great now (persisting the data in a mysql database, instead of XML files).<br><br>
At least this has led me to search more about concurrent issues and programming. I'm still confused on why this doesn't happen with my Rails backend, but I will eventually find out. Living and learning.<br><br>Thanks for the attention,<br>
<br>Marcelo.<br><br><div class="gmail_quote">On Wed, Jun 11, 2008 at 12:47 AM, Gabriel Genellina <<a href="mailto:gagsl-py2@yahoo.com.ar">gagsl-py2@yahoo.com.ar</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
En Mon, 09 Jun 2008 15:32:00 -0300, Marcelo de Moraes Serpa <<a href="mailto:celoserpa@gmail.com" target="_blank">celoserpa@gmail.com</a>> escribió:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
I've built a chat with a front-end Ajax client and backend usign ElementTree<br>
to persist the data.<br>
<br></div><div class="Ih2E3d">
In some circunstances I could not yet discover (it seems random) when I<br>
edit/save the structure, the structure gets corrupted, elementree seems to<br>
get lost in its internal "cursor", usually something like this happens:<br>
<br>
<backend><br>
<chat_list><br>
<chat id="1"><br>
<chat id="2"><br>
</chat_list><br>
</backend>id="3"/></backend><br>
<br>
Pretty strange, and it drives the whole application unusable.<br>
<br>
I don't know if the concurrent nature of the application (multiple users<br>
using the client at almost the same time and sending data to the server<br>
which in turn must save the data to the same global.xml file) has something<br>
to do with it - I don't know if ElementTree is suitable for this kind of<br>
thing. How to hanlde this concurrent issue?<br>
</div></blockquote>
<br>
I don't think it's a problem with ElementTree. Perhaps you are writing the same (global) configuration file from several threads at the same time? You may need some locking mechanism in that case.<br>
<br>
-- <br>
Gabriel Genellina<br><font color="#888888">
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>