Global AI and Data Science

Global AI & Data Science

Train, tune and distribute models with generative AI and machine learning capabilities

 View Only

DB2 Connection through IBM.EntityFrameworkCore by .Net Entity Framework

  • 1.  DB2 Connection through IBM.EntityFrameworkCore by .Net Entity Framework

    Posted Mon October 12, 2020 09:56 AM
      |   view attached
    I have db2 7.5 server on mainframe Z/VSE with connection protocol DRDA  and I want to connect to it through .Net Entity framework 
    I have added the following packages
    - EntityFramework.IBM.DB2
    - IBM.Data.DB2.Core
    - IBM.EntityFrameworkCore

    then I have tried to generate the DB Modals by running the follwing NUTGET command

    PM>Scaffold-DbContext "user id=XXXXX;password=********;server=172.28.3.7:64000;database=SQLDB;" IBM.EntityFrameworkCore -OutputDir Models -ContextDir Context -Context DBPDB_Context

    it gives me the following error and the server getting dump and stuck and I have to force a restart
    Build started...
    Build succeeded.
    IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [08001] [IBM] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "172.28.3.7". Communication function detecting the error: "recv". Protocol specific error code(s): "10060", "*", "*". SQLSTATE=08001

    at IBM.Data.DB2.Core.DB2ConnPool.Open(DB2Connection connection, String& szConnectionString, DB2ConnSettings& ppSettings, Object& ppConn)
    at IBM.Data.DB2.Core.DB2Connection.Open()
    at IBM.EntityFrameworkCore.Scaffolding.Internal.Db2DatabaseModelFactory.Create(DbConnection connection, DatabaseModelFactoryOptions options)
    at IBM.EntityFrameworkCore.Scaffolding.Internal.Db2DatabaseModelFactory.Create(String connectionString, DatabaseModelFactoryOptions options)
    at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
    at Microsoft.EntityFrameworkCore.Design.Internal.DatabaseOperations.ScaffoldContext(String provider, String connectionString, String outputDir, String outputContextDir, String dbContextClassName, IEnumerable`1 schemas, IEnumerable`1 tables, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContextImpl(String provider, String connectionString, String outputDir, String outputDbContextDir, String dbContextClassName, IEnumerable`1 schemaFilters, IEnumerable`1 tableFilters, Boolean useDataAnnotations, Boolean overwriteFiles, Boolean useDatabaseNames)
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.ScaffoldContext.<>c__DisplayClass0_0.<.ctor>b__0()
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
    ERROR [08001] [IBM] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "172.28.3.7". Communication function detecting the error: "recv". Protocol specific error code(s): "10060", "*", "*". SQLSTATE=08001




    ------------------------------
    Samir ALghazaly
    ------------------------------

    #GlobalAIandDataScience
    #GlobalDataScience