public <T> List<Long> insertAllAndGetKeys(List<T> list) {
		List<Long> identities = new ArrayList<Long>();
		if (list.size() == 0) {
			return identities;
		}
		Savepoint savepoint = null;
		try {
			Class<?> clazz = list.get(0).getClass();
			TableDefinition<?> def = define(clazz).createIfRequired(this);
			savepoint = prepareSavepoint();
			for (T t : list) {
				long key = def.insert(this,  t, true);
				identities.add(key);
			}
			commit(savepoint);
		} catch (IciqlException e) {
			rollback(savepoint);
			throw e;
		}
		return identities;
	}