none
SAPClient Code generation buffer is full after 36 calls. Reset connection and retry RRS feed

  • Question

  • I am trying to use the ADO.NET Provider for SAP (Microsoft.Data.SAPClient) and experience the following error under a heavy load.

    UPDATE: I've test this call in a standalone VB.NET application looping 500 times and the exception does not occur.  I am guessing this means it has something to do with pipelines/pipeline components and threading.

    "Code generation buffer is full after 36 calls. Reset connection and retry"

    The code being executed is below.  It is called from a custom pipeline component in a BizTalk receive port.  It works if I send a few IDOCs at a time but I I send 50 at once then it works for a while and then starts throwing the exception above.  After the exception occurs, if I send one Idoc again then the same exception is thrown.  A trace in SAP shows that the adapter rfc ZZMSBI_QUERYGENERATOR is being called.  I am thinking the exception is getting raised on the SAP side in one of the adapters rfc's. 

     

    Private
    
     Function
    
     GetAndPromoteIDOCIssuer(ByVal
    
     strIdocNum As
    
     String
    
    , ByVal
    
     strIdocClient As
    
     String
    
    ) As
    
     String
    
    	
    	Dim
    
     strSql As
    
     String
    
    		
    	Dim
    
     strSapCon As
    
     String
    
     = "TYPE=A; ASHOST=XXXX; SYSNR=XX; CLIENT=XXX; LANG=EN; USER=XXXX; PASSWD=XXXXX;"
    
    
    	'Dim DocNum As String = "717001"
    
    
    	Dim
    
     uname_initial As
    
     String
    
     = ""
    
    
    	Dim
    
     uname As
    
     String
    
     = ""
    
    
    	Dim
    
     status As
    
     String
    
     = "03"
    
    
    
    	'Init SQL and Params
    
    
    	strIdocNum = SharedFunctions.ConvertToSAPNumber(strIdocNum, 16)
    	'SAP Does Not store Null values so provide an empty string
    
    
    	uname_initial = uname_initial.PadLeft(12, " "
    
    )	
    	strSql = "SELECT TOP 1 UNAME FROM EDIDS WHERE DOCNUM = @docnum AND STATUS <= @status AND UNAME != @uname"
    
    
    	
    	'Open Connection	
    
    
    	Using
    
     sapCon As
    
     New
    
     SAPConnection(strSapCon)		
    		sapCon.Open()
    		'create command		
    
    
    		Using
    
     sapCmd As
    
     SAPCommand = sapCon.CreateCommand
    			sapCmd.CommandText = strSql
    			sapCmd.Parameters.Add(New
    
     SAPParameter("@docnum"
    
    , strIdocNum))
    			sapCmd.Parameters.Add(New
    
     SAPParameter("@status"
    
    , status))
    			sapCmd.Parameters.Add(New
    
     SAPParameter("@uname"
    
    , uname_initial))
    			
    			'Execute Command			
    
    
    			Using
    
     dr As
    
     SAPDataReader = sapCmd.ExecuteReader
    				While
    
     dr.Read			
    					uname = dr("UNAME"
    
    )
    				End
    
     While
    
    
    				dr.Close()   
    			End
    
     Using
    
    
    			sapCon.Close()
    		End
    
     Using
    
    
    	End
    
     Using
    
    	
    	Return
    
     uname
    End
    
     Function
    
    
    

     

    Does anyone have any experience with this exception or advice on how to prevent it?

     

    Additional Details

    OS: Windows 2008 R2

    Biztalk 2010

    Visual Studio 2010 targeting .NET 4 framework

    RFC SDK installed for unicode (X86)

     

    Thanks.

     

    Friday, November 19, 2010 4:15 PM

All replies

  • Still hoping someone will respond to this.  I have tried creating a singleton pattern to use in the biztalk receive pipeline.  It didn't help.  I ended up debugging the function module Z_EXTRACT_DATA_OO and ZZMSBI_QUERYGENERATOR. 

     

    I found that the execption is raised inside SAP from include program LZBI_013F01 at this line.

      catch system-exceptions generate_subpool_dir_full = 10.
        generate subroutine pool querygen->code
          name program_name
          message err
          word word
          line lin
          offset pos.
        rc = sy-subrc.
        if rc <> 0.
          perform add_message using 'E' '052' err space
                                    space space.
          exit.
        endif.
      endcatch.

    F1 on the statement "generate subroutine pool" reveals the following

    This statement generates a temporary subroutine pool . The source code of the subroutine pool is taken from the internal table itab . The generated subroutine pool is stored internally in the current internal mode . The eight-character name of the temporary subroutine pool is assigned to the variable prog .

    The line type for itab must be character type (prior to Release 6.10 flat ). A source code line in itab may contain a maximum of 255 characters. The data object prog must also be character type (prior to Release 6.10 flat). In an internal mode, a maximum of 36 temporary subroutine pools may be created.

     

    Although this appears to be an SAP limitation, it is the Function Module that gets deployed to SAP by the Microsoft Adapter that is causing the error.

     

    Friday, January 28, 2011 7:48 PM