B4J Question Necessity of closing databases and resultsets?

Erel

B4X founder
Staff member
Licensed User
Longtime User
I assume that you are asking about SQLite databases.
Is it necessary to call the "close" method on a database once we're done with it?
The database will be "closed" when the process exits. Nothing bad will happen.

What about result sets? Is it necessary to close them?
Yes, you should close them to avoid leaking resources.

Most important is to finish transactions.
 
Upvote 0

amykonio

Active Member
Licensed User
Longtime User
I assume that you are asking about SQLite databases.

The database will be "closed" when the process exits. Nothing bad will happen.

.

Hi Erel.

Is this the way it works with b4x? Does it close the connection(s) when the program finish? I've seen many times connections in sql servers that aren't really valid because a database connection wasn't properly closed at the end. This is not really an issue when you are working with a database with unlimited client connections. The server will probably kill them after awhile. But if there is a limit? Personally I always close the connections.

Andreas.
 
Upvote 0
Top