public Q forShare ( boolean fallbackToForUpdate ) { SQLTemplates sqlTemplates = configuration . getTemplates ( ) ; if ( sqlTemplates . isForShareSupported ( ) ) { QueryFlag forShareFlag = sqlTemplates . getForShareFlag ( ) ; return addFlag ( forShareFlag ) ; } if ( fallbackToForUpdate ) { return forUpdate ( ) ; } throw new QueryException ( "Using forShare() is not supported" ) ; }
FOR SHARE causes the rows retrieved by the SELECT statement to be locked as though for update .