private static String encodeWithComma(Collection<String> strings) {
        StringBuilder sb = new StringBuilder();
        for (String group : strings) {
            sb.append(group).append(',');
        }
        if (!strings.isEmpty()) {
            sb.setLength(sb.length()-1);
        }
        else {
            // Add a blank so an empty string is never replaced with NULL (oracle...arggg!!!)
            sb.append(' ');
        }
        return sb.toString();
    }
Writes large changesets to the database, using batches and transactions when
available.

The 'delete' list takes precedence over the 'add' list: when an item exists
on both lists, it is removed (and not re-added) to the database.

To prevent duplicates to exist in the database, this method will attempt to
remove all items to-be-added from the database, before re-adding them.

Note that multiple attempts to write items to the DB are made:
1) insert all pending items in a single batch
2) if the batch insert fails, retry by inserting each item separately

@param addList A list of items to be added to the database.
@param delList A list of items to be removed from the database.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/DefaultPubSubPersistenceProvider.java