lockExclusive();
roleExists = checkExists(role);
if (!roleExists)
{
// add a row to the table
Criteria criteria = RolePeer.buildCriteria(role);
RolePeer.doInsert(criteria);
// try to get the object back using the name as key.
criteria = new Criteria();
criteria.add(RolePeer.NAME, role.getName());
List results = RolePeer.doSelect(criteria);
if (results.size() != 1)
{
throw new DataBackendException(
"Internal error - query returned "