You can disconnect and reconnect the database connection with methods
in the DataSource that backs your model.
For example from the controller:
$this->ModelName->getDatasource()->disconnect();
// do long running stuff...
$this->ModelName->getDatasource()->connect();
On Oct 15, 9:44 pm, Arnold Roa <[email protected]> wrote:
> Guys,
>
> I have server A and server B, server B connects to mysql in the A server and
> do a couple of queries, then takes a few minutes uploading some large files
> to Amazon's S3 and then has to do a query on the server A but appears an
> error saying: MySQL server has gone away.
>
> I dont understand why I get this error if the connection is not persistent.
>
> the server A in my.cnf I have wait_timeout = 20, i know is because it that
> this happens and if they increase the number i would not have that problem,
> but why it creates a persistent connection instead of closing and execute
> the queries in a new connection?
>
> what can i do to open a new connection? i preffer to dont touch my my.cnf
> file.
>
> Arnold
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en