Db2

Db2

Where DBAs and data experts come together to stop operating and start innovating. Connect, share, and shape the AI era with us.


#Data


#Data
#Databases
#Operatingsystems
#Db2
#Databasesolutions
 View Only
Expand all | Collapse all

EF Core .Net 5 provider

  • 1.  EF Core .Net 5 provider

    Posted 12/01/20 03:09 PM
    When is the EF Core .Net 5 provider available?

    ------------------------------
    Jean-Pierre Nulens
    ------------------------------

    #Db2


  • 2.  RE: EF Core .Net 5 provider

    Posted 12/01/20 11:06 PM
    Hi,
     we are in the final stages of testing and plan to release the EF Core 5 provider by end of this month or first week of January. We may release a beta version before that if we find it to be at stable state. It will be released through NuGet and will be notified in the forum here.

    Thanks
    Vishwa

    ------------------------------
    Hosathota Vishwanatha
    ------------------------------



  • 3.  RE: EF Core .Net 5 provider

    Posted 12/14/20 02:11 AM
    Thanks, I am looking forward to it.

    ------------------------------
    Jean-Pierre Nulens
    ------------------------------



  • 4.  RE: EF Core .Net 5 provider

    Posted 01/22/21 04:51 AM
    Is the release postponed? We are already the 3th week of January.

    ------------------------------
    Jean-Pierre Nulens
    ------------------------------



  • 5.  RE: EF Core .Net 5 provider

    Posted 03/15/21 10:36 AM
    When updating the following table with the statement in .NET 5 application

    TEMPLATES1 t = db.TEMPLATES1.FirstOrDefault(i=>i.ID > 0);
    t.ID = t.ID;
    db.TEMPLATES1.Update(t);
    db.SaveChanges();

    (Looks like .NET 5 provider is having problems with underscores in the field name )

    I get this error message,

    IBM.Data.Db2.DB2Exception (0x80004005): ERROR [428HV] [IBM][DB2/AIX64] SQL20521N Error occurred processing a conditional compilation directive near "_". Reason code="7".
    at IBM.Data.Db2.DB2Connection.HandleError(IntPtr hHandle, SQL_HANDLE hType, RETCODE retcode)
    at IBM.Data.Db2.DB2Command.ExecuteNonQueryObject(Boolean skipInitialValidation)
    at IBM.Data.Db2.DB2Command.ExecuteNonQueryObject()
    at IBM.Data.Db2.DB2Command.ExecuteNonQuery()
    at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)



    This is the table.

    create table PRINT.TEMPLATES1
    (
    ID INTEGER generated by default as identity(minvalue 0 no cache)
    constraint CC1309199898745
    primary key,
    DOCTYPE GRAPHIC(4) not null,
    AC10 GRAPHIC(10) not null,
    URCD VARCHAR(2) default '' not null,
    TEMPLATENAME VARCHAR(256) not null,
    KEYFIELDNAME VARCHAR(100),
    REPORTTITLE VARCHAR(256),
    COMMENTS VARCHAR(1000),
    EMAIL_TO_CUST GRAPHIC(1) default 'Y' not null,
    FAX_TO_CUST GRAPHIC(1) default 'Y' not null,
    INCLUDE_BARCODE GRAPHIC(1) default 'N',
    BARCODE_SIZE SMALLINT default 0,
    CUSTOMER_NUMBER DECIMAL(8) default 0 not null,
    SHIPTO_NUMBER DECIMAL(8) default 0 not null,
    ATTACHMENT VARCHAR(1) default 'N',
    DOC_FORMAT GRAPHIC(3) default 'PDF',
    ENABLED CHARACTER(1) default 'Y' not null,
    RESETVALUE DECIMAL(5) default 7,
    COPYFLAG VARCHAR(1) default 'Y' not null,
    COMPANY_NUMBER VARCHAR(5) default '00000',
    EXT_TEMPLATE VARCHAR(256),
    BARCODE_NUM VARCHAR(25),
    EXT_DOCTYPE VARCHAR(10),
    EXT_AC10 VARCHAR(10),
    FLAG_REPRINT CHARACTER(1) default 'N',
    COPIES INTEGER default 0,
    LINK INTEGER default 0,
    BRANCH_PLANT CHARACTER(12) default '',
    PRINTEXTALWAYS CHARACTER(1) default 'N' not null,
    ONHOLD CHARACTER(1) default 'N',
    ARCHIVED CHARACTER(1) default 'N' not null,
    MOT GRAPHIC(4)
    );


    ------------------------------
    Peter Czurak
    ------------------------------



  • 6.  RE: EF Core .Net 5 provider

    Posted 03/16/21 09:45 AM
    Hi Peter,
    We created table definition in our DB2 LUW server, and then generated model via Scaffolding regular command.
    After this we tried to update the table and it worked for us.
    Could you please share the sample app to reproduce the issue in our environment. For quick resolution you may contact IBM Support Team.

    Thanks,
    Archana

    ------------------------------
    Archana Soni
    ------------------------------



  • 7.  RE: EF Core .Net 5 provider

    Posted 03/16/21 10:31 AM
      |   view attached
    Just found out this error occurs only when the update is wrapped in a transaction
    I am including the Visual Studio project.

    try
    {
    var db = new DbPrintContext();
    IDbContextTransaction dbContextTransaction = await db.Database.BeginTransactionAsync();

    TEMPLATES1 t = db.TEMPLATES1.FirstOrDefault(i=>i.ID > 0);
    t.ID = t.ID;
    db.TEMPLATES1.Update(t);
    await db.SaveChangesAsync();

    await dbContextTransaction.CommitAsync();
    }
    catch (Exception e)
    {
    Console.WriteLine(e);
    throw;
    }

    ------------------------------
    Peter Czurak
    ------------------------------

    Attachment(s)

    zip
    ConsoleApp1.zip   1 KB 1 version


  • 8.  RE: EF Core .Net 5 provider

    Posted 03/18/21 06:12 AM
    Thanks Peter, we are able to reproduce the issue.
    There is change in MS EF .NET 5, which is causing this issue. Please contact IBM Support Team to open Case.

    ------------------------------
    Archana Soni
    ------------------------------



  • 9.  RE: EF Core .Net 5 provider

    Posted 03/18/21 08:03 AM

    I don't understand why you guys just don't open the Case?  You know what is wrong you verified it, you have the error message, all the code, and the steps to reproduce it and you know your environment. So if I don't open a case this bug will not get fixed and some other developer will have to deal with this?
    I don't get it! Since this is affecting production you would think IBM would want this fixed as soon as possible.



    ------------------------------
    Peter Czurak
    ------------------------------



  • 10.  RE: EF Core .Net 5 provider

    Posted 03/18/21 08:29 AM
    Hi Peter,
     agree with you. As soon as we noticed the issue, we prioritize it and fix it. It will be available in the next version update. If you are blocked by this and you need a special build sooner than the next version, you may want to open a case with IBM.

    Thanks
    Vishwa

    ------------------------------
    Hosathota Vishwanatha
    ------------------------------



  • 11.  RE: EF Core .Net 5 provider

    Posted 03/18/21 08:39 AM
    Thank You!
    I appreciate your response.
    I can live with it the way it is for now because it works without transactions so I can create a workaround for the time being.

    ------------------------------
    Peter Czurak
    ------------------------------