private static void toPubsubData( List<PubsubRecordData> newRecords )
    {
        Log.info( "Writing Pubsub entities." );
        Connection con = null;
        boolean abortTransaction = false;

        try
        {
            con = DbConnectionManager.getTransactionConnection();
            for ( final PubsubRecordData newRecord : newRecords )
            {
                if ( !hasRootNode( con, newRecord.serviceID ) )
                {
                    writeRootNode( con, newRecord.serviceID );
                }
                writeNode( con, newRecord );
                writeItem( con, newRecord );
                writeAffiliation( con, newRecord );
            }
        }
        catch ( SQLException e )
        {
            abortTransaction = true;
        }
        finally
        {
            DbConnectionManager.closeTransactionConnection( con, abortTransaction );
        }
    }
Creates appropriate database entries for each pubsub record
@param newRecords A collection of pubsub representations (can be empty, cannot be null).
xmppserver/src/main/java/org/jivesoftware/database/bugfix/OF1515.java