I am having fb remote event with which I listen to database and I start it with my app load inside thread.
When I run it on my Windows 10 (local pc) it works normally and perfect BUT when I run it on Windows Server 2003 it start filling RAM Memory a lot more than it should and when it reach server limit it just closes.
Here is my code:
private void DataBaseEventListner()
{
FbRemoteEvent revent = new FbRemoteEvent(M.Baza.connectionString);
FbRemoteEvent revent1 = new FbRemoteEvent(M.Baza.connectionKomercijalno2018);
revent.RemoteEventCounts += (sender, e) =>
{
this.Invoke(new MethodInvoker(delegate
{
Poruka p = new Poruka(Magacin.Poruka.UcitajPoslednjuPorukuID(Korisnik.korisnikId));
p.Show();
}));
};
revent1.RemoteEventCounts += (sender, e) =>
{
switch (e.Name)
{
case "PP_NEW":
case "PP_UPD":
Thread thread1 = new Thread(UcitajPoslovnePartnere);
thread1.Start();
break;
}
};
revent.QueueEvents(String.Format("nova_poruka~" + Korisnik.korisnikId.ToString()));
revent1.QueueEvents(new string[] { "PP_NEW", "PP_UPD" });
}
private void UcitajPoslovnePartnere()
{
poslovniPartneri = Komercijalno.Partner.Lista();
}
public static List<Int_String> Lista()
{
List<Int_String> list = new List<Int_String>();
using (FbConnection con = new FbConnection(M.Baza.connectionKomercijalno2018))
{
con.Open();
using (FbCommand cmd = new FbCommand("SELECT PPID, NAZIV FROM PARTNER ORDER BY NAZIV", con))
{
FbDataReader dr = cmd.ExecuteReader();
list.Add(new Int_String { _int = -1, _string = "<izaberi partnera>" });
while (dr.Read())
list.Add(new Int_String { _int = Convert.ToInt32(dr[0]), _string = dr[1].ToString() });
}
con.Close();
}
return list;
}
I wrapped this in a try-catch
and the error I get is:
Error reading data from the connection.
at FirebirdSql.Data.FirebirdClient.FbRemoteEvent.QueueEvents(String[] events)
at Magacin.Main.DataBaseEventListner()
In firebird log I get
TERMINAL_64 (Server) Sat Jun 30 17:03:52 2018
INET/inet_error: read errno = 10054
I tried setting Pooling=false
but still not working
I am loading my connection string from .TXT
and when i am loading it i am building it like this:
string[] data = line.Split('|');
//Here I do something with data[0] which is not part of connection string
Baza.connectionString = System.String.Format(@"data source={3};initial catalog = {0};user={1};password={2}", data[1], data[2], data[3], data[4]);
String inside my .TXT
file is:
C:\Prirucni Magacin\PRIRUCNIMAGACIN.FDB|SYSDBA|masterkey|localhost //This is on local pc
so final string looks like:
data source=localhost;initial catalog = C:\Prirucni Magacin\PRIRUCNIMAGACIN.FDB;user=SYSDBA;password=masterkey
UcitajPoslovnePartnere
. – Perishing<package id="FirebirdSql.Data.FirebirdClient" version="5.12.0" targetFramework="net40" />
– DowlingPOST_EVENT
) and it still crashes... – DowlingFirebird 2.1.7.18553
and.NET 4
but cannot findFirebird .NET provider
. Does that changes something? – Dowling32bit
. On my local pc it gets around 45MB on server it gets to 120MB and crash. – Dowling