Hi, I'm currently deploying OpenFire in a research environment. Checking the logs I found the following error:
DELETE ofPubsubItem FROM ofPubsubItem LEFT JOIN (SELECT id FROM
ofPubsubItem WHERE serviceID=uuuuuuu@dddddddd AND nodeID=http://jabber.org/protocol/geoloc ORDER BY creationDate DESC LIMIT 1) AS noDelete
ON ofPubsubItem.id = noDelete.id WHERE noDelete.id IS NULL AND ofPubsubItem.serviceID = uuuuuuu@dddddddd AND nodeID = http://jabber.org/protocol/geoloc
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(Abst ractJdbc2Statement.java:2531)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java: 1344)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:343)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement .java:2670)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
at org.postgresql.PGStatement$$EnhancerByProxool$$6a8d54dc.executeBatch(<generated >)
at org.jivesoftware.openfire.pubsub.PubSubPersistenceManager.purgeItems(PubSubPers istenceManager.java:1878)
I tested the query against PostgreSQL (adding the corresponding quotes) and got a sintax error.
So, I looked into the source code and found this:
privatestaticfinalStringPURGE_FOR_SIZE =
"DELETE ofPubsubItem FROM ofPubsubItem LEFT JOIN " +
"(SELECT id FROM ofPubsubItem WHERE serviceID=? AND nodeID=? " +
"ORDER BY creationDate DESC LIMIT ?) AS noDelete " +
"ON ofPubsubItem.id = noDelete.id WHERE noDelete.id IS NULL AND " +
"ofPubsubItem.serviceID = ? AND nodeID = ?";
I guess that it can be rewrited as:
private static final String PURGE_FOR_SIZE =
"DELETE from ofPubsubItem where id in (select ofPubsubItem.id FROM ofPubsubItem LEFT JOIN " +
"(SELECT id FROM ofPubsubItem WHERE serviceID=? AND nodeID=? " +
"ORDER BY creationDate DESC LIMIT ?) AS noDelete " +
"ON ofPubsubItem.id = noDelete.id WHERE noDelete.id IS NULL AND " +
"ofPubsubItem.serviceID = ? AND nodeID = ?)";
that seems to do the purging process in PostgreSQL
I build the source and replace the class in the openfire.jar, restarted openfire and then the error dissapear with no other effects.
I hope that you can review this purging process. Thanks in advance.
PD: Sorry if this post is a dupplicate, I've searched the forum for a while without results about this specific topic.