Topic
  • 2 replies
  • Latest Post - ‏2019-02-13T16:33:50Z by menalb
JVPay
JVPay
1 Post

Pinned topic ibm.entityframeworkcore hangs on db connection

‏2018-08-28T22:05:11Z | c# entityframework

When trying to use the ibm.entityframeworkcore nuget package v1.2.2.100 my application hangs forever when attempting to open the connection. The sample app I created is very simple, the meat of the code is pasted below. I never get an error it just literally hangs forever. I've googled around all day and haven't been able to find anything helpful, does anyone have any ideas on what could be causing my issue?

 

 

using IBM.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using IBM.EntityFrameworkCore.Storage.Internal;

namespace Db2ConsoleTest
{
    public class MyContext : DbContext
    {
        public MyContext()
            : base(buildContextOptions())
        { }

        private static DbContextOptions buildContextOptions()
        {
            var builder = new DbContextOptionsBuilder();
            builder.UseDb2(@"Server=<server>:<port>;Database=<dbname>;userid=<userId>;password=<pwd>", p => p.SetServerInfo(IBMDBServerType.AS400, IBMDBServerVersion.AS400_07_02));
            return builder.Options;
        }

        public virtual DbSet<Provider> Providers { get; set; }
    }
}

 

 

static void Main(string[] args)
{
    var context = new MyContext();

    Console.WriteLine("\nProvider Detail:");
    Console.WriteLine("--------------------");

    context.Database.OpenConnection();
    Console.WriteLine("done");
    context.Database.CloseConnection();    

}

 

  • VishDev2018
    VishDev2018
    65 Posts

    Re: ibm.entityframeworkcore hangs on db connection

    ‏2018-09-19T20:55:33Z  

    Hi,

     are you still facing this issue? Have you made sure the connection is possible from outside of EF?

     

    Thanks

    Vishwa

     

  • menalb
    menalb
    1 Post

    Re: ibm.entityframeworkcore hangs on db connection

    ‏2019-02-13T16:33:50Z  

    Hi,

     are you still facing this issue? Have you made sure the connection is possible from outside of EF?

     

    Thanks

    Vishwa

     

    Hello.

    I am having the same issue.

    Using the IBM.Data.DB2.Core  1.3.0.100, when it tries to open the connection it hands forever.

    Is there a way to debug this issue and understand what is the problem?

    Thanks