Embedded Firebird unload delay - firebird

After I close my application fbclient.dll remains in memory for about 3 seconds. So it locks the database file and prevents my application from unloading. I'm using Firebird embedded.
The problem is related to events. I signup to events using isc_que_events. If I don't signup to events dll unloads instantly.
I faced this problem in previous FB versions and now in 2.1.3 it's still the same.
The same issue is described here http://tracker.firebirdsql.org/browse/CORE-15, but it's resolved as "Cannot Reproduce".
Is anybody facing this problem or there's something wrong with my code?

Are you using the .NET Provider? This one keeps connections open in a pool, maybe this is the problem. Try clearing the connection pool before exiting your application:
FbConnection.ClearAllPools();

I've rewritten my logic and now I don't need to subscribe to local events. So it's not a problem for me anymore. But the issue still remains.

Related

Is there a way to check how many open watch() connections are there?

I created a web-app that utilizes db.collection.watch() to observe database changes.
However, after a few weeks, the app becomes sluggish and I have to fix it by restarting the backend - which hints at some memory leaks.
My fear is that my db.collection.watch() calls are not being properly closed, so it would be helpfull if I could see how many are actually open at any given time.
Is there a mongo command that can provide this information?

Problem using signalr for chat application flutter

I had made a whole chat application using signalr as a socket with the online and offline facility. I am facing a few problems,
Signalr connection is always time out after some time, to overcome that I had condition if hubconnection is not connected then create new hubconnection (onResume app), but still it get hubconnection._callback got increased when sending message and not moving to server side socket. Again need to refresh whole app.
Can someone tell me whether this is problem because there are lot of operations going on and so signalr loses its connection as flutter is single thread and it cannot handle much? or should I use Isolate or inherit widget.
Summary problem:
I cannot send message in chat after sometime. It stores all message in hubconnection._callback and not going for server.
Is anything better solution to keep alive in both Android+iOS.
I had used https://pub.dev/packages/signalr_netcore package.
Please do not mention about firebase.
Any other logic suggestion is appreciable.
Thank you.
I've been using a different package, https://pub.dev/packages/signalr_core, which works fine without any particular issues what I have observed at the moment.
I'm only running about 10 listeners simultaneously, not sure if that is more or less than you. In the package I'm running you can establish connection with automatic reconnect. It looks like this:
HubConnectionBuilder().withAutomaticReconnect().withUrl(....)
It seems like your package have the same functionality... Have you tried that?

Why is sqflite retaining open database reference on hot reload

I have an app that checks for an sqflite db file in the app storage directory and if it is present, blows away the file and creates a new one and then opens it for the remainder of the app life. What I have noticed is that hot restart fails with sql exceptions because it still sees the database as open somewhere in memory even though all my references are blown away due to the restart. This seems like a bug because I have no way to control the closing of that database unless I try to make sure it is closed if the application is killed. Is this by design? Is there a standard way to approach it?
I noticed this related post
Your assumption and investigation are correct. With bad words, what happens during hot restart is that the dart environment is restarted while the native world is still running and for sqlite that means that open databases remain opened with no easy way to know that from the dart side.
The hot-restart hack in place in sqflite is meant mainly to handle hotrestart even if you are in a sqlite transaction. Without this hack, it should happen what you describe in your scenario. That is said deleteDatabase should be used instead of removing manually the file.
In theory, this should be handled in openDatabase and deleteDatabase.
Can you confirm that you are indeed using deleteDatabase? If yes, in the mean time your workaround is safe and reporting an issue on sqflite for investigation would be great. Thanks!
After further testing it looks like 1 way to handle this is to check for the existence of the file. If the file exists, go ahead and open it using sqflite's openDatabase method. Then immediately close it. Then delete the file using io file delete method. Then you can create a new database file using the openDatabase method. This solution is maybe a little more expensive than I had hoped but it is working.

Realm Swift: Handling/preventing sync error 108

I've been testing the new platform over the last couple weeks and have had trouble with syncing reliability, occasionally getting an error 108 inside the SyncManager.sharedManager error handler. I see from the documentation that error is described as:
“Client file bound in other session (IDENT)” Indicates that multiple sync sessions for the same client-side Realm file overlap in time.
However, I'm not really sure what this means or how to go about debugging it. Any advice?
solved... maybe?: I found there is a logOut() method in the RLMSyncUser class which seems to flush any open sync sessions. I've added this to my error handler which will hopefully reset sync states.
This was an issue with older Realm Object Server versions, but has been fixed since version 1.0.0-BETA-2.2. Please update to a newer version of the Realm Object Server. 1.0.0-BETA-4.2 currently.

Troubleshooting Azure SQL connection issues

I have an ASP.NET application that is using Entity Framework 6 to access data stored in an Azure SQL database. I've run into a bit of a problem connecting to the database as a whole.
If I spawn a new database instance on Azure, start my app in the debugger and step through it, I'll see that it connects without a problem, can access the seed data and all is well (inserts work without a problem, but this occurs whether I change the data or not).
However, if I restart the debugger and at all points after that attempt to connect to the database when my app restarts, the connection will fail. If I set a breakpoint and look at the Context value in the Locals window, I have the following error as the value for all DbSets:
Function evaluation disabled because a previous function evaluation
timed out. You must continue execution to reenable function
evaluation.
Despite having a try/catch around the logic, no exception will be thrown. If I step into/out of/over this, the application will just run indefinitely and never complete.
If I do a rollback to the $InitialDatabase and then re-apply the automatic migration (via update-database), I still cannot connect to the database, however if I delete the database in Azure, spin up a new one, set up the new connection information in the Web.config file and execute all over again, it'll work like a charm one time. After that, it'll fail to work again, despite no other changes to the application.
What's going on here and why is this behavior occurring? If there's an underlying problem here, how could I tell what it is and how can I resolve it?
Thanks!
After making no headway, I rolled-back to a previous version of my code from when it was working fine about three weeks back. I've updated all the logic to match what was in the latest build, I just haven't updated any of the assemblies yet. It's working perfectly fine and connecting every time now, so apparently this is the fault of one of the as-of-yet unidentified dependencies.
If I ever determine which one, I'll update this answer accordingly.