Too many conections...

145 views
Skip to first unread message

Orgos

unread,
Mar 18, 2013, 11:31:23 AM3/18/13
to pha...@googlegroups.com
I have this piece of code


Running it I got this error message: SQLSTATE[HY000] [1040] Too many connections

I presume is because the transaction object is creating new connections, I'm wondering if there is a way to close those connection I'm not using any more? and keep running the code without touching Mysql settings.

Thanks.

Igor Ivanovic

unread,
Mar 18, 2013, 11:38:23 AM3/18/13
to pha...@googlegroups.com
It`s not problem of phalconphp your mysql server have transaction limit.
That`s why it returns error.

http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html
> --
> You received this message because you are subscribed to the Google Groups
> "Phalcon PHP Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phalcon+u...@googlegroups.com.
> To post to this group, send email to pha...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/phalcon/-/MSefsN-IKiMJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Orgos

unread,
Mar 18, 2013, 12:05:15 PM3/18/13
to pha...@googlegroups.com
Good.

Seeing this in the documentation.

public collectTransactions ()

Remove all the transactions from the manager.

Looks like the manager clear all the existing transactions objects right?

If I call $manager->get(); Is gonna return back a new transaction object, no matter what?


Thanks.

Igor Ivanovic

unread,
Mar 18, 2013, 12:12:37 PM3/18/13
to pha...@googlegroups.com

Orgos

unread,
Mar 18, 2013, 12:22:28 PM3/18/13
to pha...@googlegroups.com
I have updated the code, you pls mind to run it?

The sql:


CREATE TABLE `project` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`description` text,
`created` date NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=446 DEFAULT CHARSET=latin1;


CREATE TABLE `target` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`created` date NOT NULL,
`project_id` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=446 DEFAULT CHARSET=latin1;


Thanks.
Reply all
Reply to author
Forward
0 new messages