Global Data Management Forum

 View Only
  • 1.  #DB2 IBM.EntityFrameworkCore

    Posted Fri December 01, 2023 12:03 PM

    Hi,

    I have implemented IBM.EntityFrameworkCore in .Net 7.0 apllication.

    Created a DbContext and implemented OnConfiguring:

    I experience a delay of approximately 15 second when the connection opens the first time.

    Is this a known problem? Or has it something to do with de settings of the server.

    Best regards,

    Robert



    ------------------------------
    Robert van der Doelen
    ------------------------------


  • 2.  RE: #DB2 IBM.EntityFrameworkCore

    Posted Mon December 18, 2023 10:23 AM

    Hi Robert,

    I have created a C# 7 Web API with EF using Net.IBM.Data.Db2 and IBM.EntityFrameworkCore.  It appears to be connecting to the iSeries and then returns :

    IBM.Data.Db2.DB2Exception (0x80004005): ERROR [08004] [IBM] SQL30061N  The database alias or database name "filename    " was not found at the remote node.  SQLSTATE=08004

    Connection string :

    "Server=xxx.xxx.com:446; Database=filename; UID=*****; PWD=*****;"
    Can you give me some insight on what drivers you are using ?  What does your connection string look like ?
    There is very little information out there regarding how to configure this.  Any help is appreciated !


    ------------------------------
    Richard Rothe
    ------------------------------



  • 3.  RE: #DB2 IBM.EntityFrameworkCore

    Posted Tue December 19, 2023 10:58 AM

    I'm the owner of and don't know why people. Keep hacking me and to the AI techs.Im sorry that one of the Microsoft tech guys\owner's erasing everything. 



    ------------------------------
    [Christopher ] [Green][ csg188]
    [Owner of IBM] christopher s green email greenforever188@outlook.com
    [IBM ]
    [commerce] [Georgia ]
    [7064292633]
    ------------------------------



  • 4.  RE: #DB2 IBM.EntityFrameworkCore

    Posted Tue December 19, 2023 11:17 AM

    Hey Richard,

    I use the same assemblies as you are using, so that looks good.

    The connection string in my app looks like this:
    "Server=xxx.xxx.com:446;Pooling=true;Connection Lifetime=300;Connection Reset=false;CurrentSchema=SchemaName;Database=DbName;UserID=xxxxxx;password=xxxxxx;IsolationLevel=Chaos"

    Contact your administrator for the proper databasename and schemaname.
    The IsolationLevel I have to use it that way, but I'm looking for a better solution.

    Regards,

    Robert



    ------------------------------
    Robert van der Doelen
    ------------------------------



  • 5.  RE: #DB2 IBM.EntityFrameworkCore

    Posted Tue December 19, 2023 11:34 AM

    I think I am using the correct values in the connection string because now I am getting the error about a license being required.

    I understand there may be a trial license available, but not sure how to request one.

    IBM.Data.Db2.DB2Exception (0x80004005): ERROR [42968] [IBM] SQL1598N  An attempt to connect to the database server failed because of a licensing problem.  SQLSTATE=42968



    ------------------------------
    Richard Rothe
    ------------------------------



  • 6.  RE: #DB2 IBM.EntityFrameworkCore

    Posted Wed December 20, 2023 02:32 AM

    Hi Richard,

    You are using the correct connection string properties.

    Now you have to get a proper license, see for example https://stackoverflow.com/questions/70446909/license-error-while-making-connection-ibm-db2-using-python-and-ibm-db-library.

    Contact your DBA how to get one. 



    ------------------------------
    Robert van der Doelen
    ------------------------------



  • 7.  RE: #DB2 IBM.EntityFrameworkCore

    Posted Wed December 20, 2023 10:17 AM

    I have no issues connecting using the IBM i Access for Windows ODBC data source.  However, I am trying to use Entity Framework and I thought it required the Net.IBM.Data.Db2 package. 

    I do see a license folder in the IBM I Access Client Solutions setup with a bunch of .txt files.  The stack overflow thread seems to imply that there is a license file there that I can use



    ------------------------------
    Richard Rothe
    ------------------------------