Update apikey/secretkey in transaction

This commit is contained in:
Alena Prokharchyk 2012-02-10 16:08:48 -08:00 committed by Salvatore Orlando
parent baf6b6eb82
commit a3fb4cf9c1
1 changed files with 4 additions and 1 deletions

View File

@ -1777,7 +1777,7 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
return _accountDao.findUserAccountByApiKey(apiKey);
}
@Override
@Override @DB
public String[] createApiKeyAndSecretKey(RegisterCmd cmd) {
Long userId = cmd.getId();
@ -1787,8 +1787,11 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
// generate both an api key and a secret key, update the user table with the keys, return the keys to the user
String[] keys = new String[2];
Transaction txn = Transaction.currentTxn();
txn.start();
keys[0] = createUserApiKey(userId);
keys[1] = createUserSecretKey(userId);
txn.commit();
return keys;
}