Recently we were getting the Generic SQL Error in one of our Plugin which was registered in Create of Opportunity Line.
The scenario was that on qualifying the lead, opportunity was getting created and we had Async Plugin on Create of Opportunity that will create an Opportunity Line and had Sync Plugin on Create of Opportunity Line that was updating the parent Opportunity. This issue was occurring randomly.
We observed the following, that if both the Plugin are registered as Sync or Async the issue doesn’t occur. It also doesn’t occur if we have Opportunity Plugin on Create as Sync and the one on Opp. Line as Async.
The other way of solving the issue was to introduce delay before updating the Parent Opportunity from the child opportunity line create Plugin.
Hope this helps..