• cbarry9
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

When performing a SOQL query from Apex using the FOR UPDATE option, is the locking mechanism optimistic or pessimistic? In other words, if another user attempts to write to the same record, while it is locked FOR UPDATE by another user, will they wait (optimistic), or will they be returned an error immediately (pessimistic).

 

thanks in advance,

 

Chris

When performing a SOQL query from Apex using the FOR UPDATE option, is the locking mechanism optimistic or pessimistic? In other words, if another user attempts to write to the same record, while it is locked FOR UPDATE by another user, will they wait (optimistic), or will they be returned an error immediately (pessimistic).

 

thanks in advance,

 

Chris

Hi i was wondering could someone give me an example on how to get <apex:message> to work, for example i have field called contact name and want the error to be shown on that field.

 

if(!IsDuplicateLink()) { insert s; } else { Account dupe = [SELECT Id, Name FROM Account WHERE Id = :eId]; ApexPages.Message dupeMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'Contact already exists in ' + dupe.Name); ApexPages.addMessage(dupeMsg); drawError = true; } <apex:message for="conName"/> <apex:inputField id="conName" value="{!Contact.Name}"/>

 

for some reason this does not work?