evan_wise

MUC - History retrieval question from review of MUCPersistanceManager.java

Discussion created by evan_wise on Jul 26, 2007
Latest reply on Sep 25, 2007 by evan_wise

Hello all,

 

This is a follow on to this issue point #2.

 

The problem I am experiencing is that after a server restart a multi-user chat room no longer displays any history, it essentially starts fresh. The data however, is still stored in the DB (Oracle in our case).

 

I have acquired the source to Openfire 3.3.2 and after some digging around in the persistance manager I have come across two SQL queries that I don''t quite understand.

I am referring to Revision: 1623 of MUCPersistanceManager.java as part of the 3.3.2 source bundle.

 

private static final String LOAD_HISTORY =
        "SELECT sender, nickname, time, subject, body FROM mucConversationLog " +
        "WHERE time>? AND roomID=? AND (nickname <> '''' OR subject IS NOT NULL) ORDER BY time";
....
private static final String LOAD_ALL_HISTORY =
        "SELECT roomID, sender, nickname, time, subject, body FROM mucConversationLog " +
        "WHERE time>? AND (nickname <> '''' OR subject IS NOT NULL) ORDER BY time";

I have run these queries from a SQL prompt and they only seem to return the create room message and any messages that changed the subject. "Normal" messages sent from users are not retrieved.

 

If I remove the "AND (nickname  '''' OR subject IS NOT NULL)" from the SQL queries I get all the history of the chat room.

 

What is the intended behaviour of this component?

 

Cheers,

E/.

 

Outcomes