Hi:
I’m working on a project that uses pep service for event notifications, the thing is that I found an issue with the lastPublished property (LeafNode class). Seems that this property is set in memory when the item is published (also is stored in db by another thread), so after a while the PEPService is removed from cache (full or lifetime) and the next time that is loaded from DB it doesn’t populate lastPublished property (from DB), so later when a client performs a login against openfire it doesn’t receive the lastPublished property cause is null. What I did is to modify the getLastPublishedItem (LeafNode.class) method and add some code to grab the last published property from DB whether is not already in memory, I used an already existing method from PubSubPersistenceManager class called getLastPublishedItem (BTW this method is running a query that blow up due to a missing column in the select statement which is the id column, should be added first). Please let me know if I’m missing something or if it is not the right approach!
Code that I modified in the LeafNode java class
@Override
public synchronized PublishedItem getLastPublishedItem() {
// added by JMM to force last published item load from db
// whether is not already in memory, made it synchronized
if (lastPublished == null) {
lastPublished = PubSubPersistenceManager.getLastPublishedItem(this);
}
return lastPublished;
}
Thanks in advance!