public long getNextValue(String sequenceName) {
		SelectSql selectSql = new SelectSql()
				.setTableName(SEQ_TABLE_NAME)
				.setColumns(SEQ_VALUE_COLUMN_NAME)
				.setWhereClause(
						new WhereClause(LogicalOp.AND).addStringClause(
								SEQ_NAME_COLUMN_NAME, RelationOp.EQUAL,
								sequenceName));
		RowList rs;
		try {
			rs = query(selectSql);
		} catch (DbKingException e) {
			try {
				initSequenceTable();
			} catch (DbKingException e1) {
			}
			try {
				initSequenceRow(sequenceName);
			} catch (DbKingException e1) {
			}
			rs = query(selectSql);
		}
		if (rs.size() == 0) {
			try {
				initSequenceRow(sequenceName);
			} catch (DbKingException e) {
			}
			rs = query(selectSql);
		}
		Row row = rs.get(0);
		BigDecimal seqValue = row.getNumber(SEQ_VALUE_COLUMN_NAME);
		BigDecimal nextSeqValue = seqValue.add(BigDecimal.ONE);
		int count = 0;
		while (count == 0) {
			count = execute(new UpdateSql()
					.setTableName(SEQ_TABLE_NAME)
					.setUpdateKeyValueClause(
							new UpdateKeyValueClause().addNumberClause(
									SEQ_VALUE_COLUMN_NAME, nextSeqValue))
					.setWhereClause(
							new WhereClause(LogicalOp.AND).addStringClause(
									SEQ_NAME_COLUMN_NAME, RelationOp.EQUAL,
									sequenceName).addNumberClause(
									SEQ_VALUE_COLUMN_NAME, RelationOp.EQUAL,
									seqValue)));
			if (count == 1) {
				break;
			}
			seqValue = nextSeqValue;
			nextSeqValue = seqValue.add(BigDecimal.ONE);
		}
		return nextSeqValue.longValue();
	}