B4J Question java.net.SocketException: broken pipe mysql

jayel

Active Member
Licensed User
Longtime User
Hello,

This happened when my mysql becomes idle for about 8 hours and I want to execute an sql query on a table.
Now I read around and saw the connection pool resolution.

Will my connection pool remain active after 8 hours?
Or can somebody clearafy what this connection pool does?


Thanks
John
 

dar2o3

Active Member
Licensed User
Longtime User
You can configure your session state variable wait_timeout mysql, default is set to 28800 (this is the time it leaves mysql connections waiting.)

You can change it easily using:
B4X:
SET session wait_timeout = 300;

When you restart the server, this will return to its default value 28800.
 
Upvote 0

jayel

Active Member
Licensed User
Longtime User
When I reduce the time, wil it destroy the connection after 300 sec?

And what about this connection pool solution?
 
Upvote 0

dar2o3

Active Member
Licensed User
Longtime User
(In theory)
Basically, these "pool" provide us with the connections as we asked, but "reaprovechan" a request to another. The idea is this: We asked the pool a connection. This look for one that is free and gives it to us, pointing that we have and which is no longer free. We conduct our operation (query, insert, delete, ...) and close the connection. The pool receives this request and NO closing closes the connection, but leaves it open and redials free to ask the next thing.
With this way of working, the pool maintains several open connections that will serve and marking as used as ask. When these connections from outside are closed, the pool are not closed and marked as free, to use.
 
Upvote 0

jayel

Active Member
Licensed User
Longtime User
OK euhmm thx but the only thing I can read is (In theory)...
Cab you repond in English please ?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…