public void doCopy() throws SQLException
	{
		sourceCw = source.getConnectionWrapper();
		ConnectionWrapper targetCw = target.getConnectionWrapper();
		// find the number of objects in the source database
		long count = getCount();
		// find the smallest object id in the source
		Long currentId = getSmallestId();
		// iterate over all object ids in the source
		try
		{
			// read the objects, one by one,
			// save each object
			for (long current = 0; current < count; current++)
			{
				if (currentId == null)
				{
					break;
				}
				Object currentObject = source.getObject(sourceCw, Object.class,
						currentId);
				if (!currentObject.getClass().isArray())
				{
					// only non-arrays are treated as proper objects.
					target.saveObjectUnprotected(targetCw, currentObject);
					copyExternalProtection(targetCw, currentObject);
					targetCw.commit();
				}
				// get the next id
				currentId = getSmallestIdLargerThan(currentId);
			}
		}
		catch (ClassNotFoundException | IOException e)
		{
			throw new SQLException(e);
		}
		finally
		{
			sourceCw.commitAndDiscard();
			targetCw.commitAndDiscard();
		}
	}