createAuthorizationCode should be @Transactional
An Authentication should not exist without its matching AuthorizationCode, but typically an AuthorizationCode will have a foreign key on an Authentication, meaning it can't be saved first. This block should be wrapped in a transaction so that other DB clients (say, for example, clearExpiredAuthorizationCodes) don't see an inconsistent snapshot and then misbehave.pull/1079/merge
parent
c3d0c18af5
commit
7725fcfa2b
|
@ -66,6 +66,7 @@ public class DefaultOAuth2AuthorizationCodeService implements AuthorizationCodeS
|
||||||
* @return the authorization code
|
* @return the authorization code
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(value="defaultTransactionManager")
|
||||||
public String createAuthorizationCode(OAuth2Authentication authentication) {
|
public String createAuthorizationCode(OAuth2Authentication authentication) {
|
||||||
String code = generator.generate();
|
String code = generator.generate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue