@Override
    public void createDefaultConfiguration(PubSubService.UniqueIdentifier serviceIdentifier, DefaultNodeConfiguration config)
    {
        final String key = getDefaultNodeConfigurationCacheKey( serviceIdentifier, config.isLeaf() );

        final Lock lock = defaultNodeConfigurationCache.getLock( DEFAULT_CONF_CACHE );
        lock.lock();
        try
        {
            Connection con = null;
            PreparedStatement pstmt = null;
            try {
                con = DbConnectionManager.getConnection();
                pstmt = con.prepareStatement(ADD_DEFAULT_CONF);
                pstmt.setString(1, serviceIdentifier.getServiceId());
                pstmt.setInt(2, (config.isLeaf() ? 1 : 0));
                pstmt.setInt(3, (config.isDeliverPayloads() ? 1 : 0));
                pstmt.setInt(4, config.getMaxPayloadSize());
                pstmt.setInt(5, (config.isPersistPublishedItems() ? 1 : 0));
                pstmt.setInt(6, config.getMaxPublishedItems());
                pstmt.setInt(7, (config.isNotifyConfigChanges() ? 1 : 0));
                pstmt.setInt(8, (config.isNotifyDelete() ? 1 : 0));
                pstmt.setInt(9, (config.isNotifyRetract() ? 1 : 0));
                pstmt.setInt(10, (config.isPresenceBasedDelivery() ? 1 : 0));
                pstmt.setInt(11, (config.isSendItemSubscribe() ? 1 : 0));
                pstmt.setString(12, config.getPublisherModel().getName());
                pstmt.setInt(13, (config.isSubscriptionEnabled() ? 1 : 0));
                pstmt.setString(14, config.getAccessModel().getName());
                pstmt.setString(15, config.getLanguage());
                if (config.getReplyPolicy() != null) {
                    pstmt.setString(16, config.getReplyPolicy().name());
                }
                else {
                    pstmt.setString(16, null);
                }
                pstmt.setString(17, config.getAssociationPolicy().name());
                pstmt.setInt(18, config.getMaxLeafNodes());
                pstmt.executeUpdate();

                defaultNodeConfigurationCache.put( key, config );
            }
            catch (SQLException sqle) {
                log.error("An exception occurred while trying to store default configuration to the database for service {} (is leaf type: {})", serviceIdentifier, config.isLeaf(), sqle);
            }
            finally {
                DbConnectionManager.closeConnection(pstmt, con);
            }
        }
        finally
        {
            lock.unlock();
        }
    }
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