Original Message:
Sent: Wed May 14, 2025 12:46 PM
From: Marco Ayala
Subject: IBM. EntityFrameworkCore slowness opening connection DB2
Hi Jan,
By any chance do you think it is something of the AS400 version, because this incident only happens in the first connection to db2, it takes so long that my response SLA must be less than 3 seconds.
------------------------------
Marco Ayala
Original Message:
Sent: Sat May 10, 2025 05:48 AM
From: Jan Nelken
Subject: IBM. EntityFrameworkCore slowness opening connection DB2
Sorry - I don't know AS400 enough to advise more - I use Db2 for LUW.
Toronto Lab motto was Db2 is Db2 is Db2 - there are soe microdifferences though :-)
------------------------------
Jan Nelken
Db2 (LUW) DBA
Open for job
Katowice or Krakow
+48 783 109 863
Original Message:
Sent: Thu May 08, 2025 05:04 PM
From: Marco Ayala
Subject: IBM. EntityFrameworkCore slowness opening connection DB2
Hello Jan
thank you very much for your answer the one we are using is IBMDServerType.AS400 and the version IBMDBServerVersion.AS400_07_02
------------------------------
Marco Ayala
Original Message:
Sent: Thu May 08, 2025 01:18 PM
From: Jan Nelken
Subject: IBM. EntityFrameworkCore slowness opening connection DB2
What is platform and version of Db2 you are trying to connect to?
Is the database activated?
------------------------------
Jan Nelken
Db2 (LUW) DBA
Open for job
Katowice or Krakow
+48 783 109 863
Original Message:
Sent: Tue May 06, 2025 03:32 PM
From: Marco Ayala
Subject: IBM. EntityFrameworkCore slowness opening connection DB2
We are developing with IBM.EntityFrameworkCore and netcore version 7 with imb license to deploy it in aks, however whenever you connect the first time to the database exceeds 30 seconds but if you connect again it takes 1 second, we have done tests and we have evidenced that this happens only when you have inactivity, question this is normal? or what should we do so that the connection to the database db2 is not delayed too much?
example code
public ClienteEntity ObtenerCliente(int id)
{
try
{
using (var context = new MiDbContext()) // Usa tu clase DbContext
{
var entidad = context.ClienteEntities
.AsNoTracking() // Opcional: mejora el rendimiento si no vas a modificar el objeto
.FirstOrDefault(e => e.Id == Id);
return entidad ?? new ClienteEntity();
}
}
catch (Exception)
{
throw;
}
}
Add logs

------------------------------
Marco Ayala
------------------------------