Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Cakephp, gearman workers and changing database connection on the fly issue
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ketan  
View profile  
 More options Sep 15 2012, 12:29 am
From: Ketan <ketan.s...@gmail.com>
Date: Fri, 14 Sep 2012 21:29:41 -0700 (PDT)
Local: Sat, Sep 15 2012 12:29 am
Subject: Cakephp, gearman workers and changing database connection on the fly issue

howdy!

We have created a SaaS app using cakephp 1.3 which is pulling in data from
a 3rd party API and populating the database (each subdomain has its own
database) . We are in process of moving our architecture to a gearman for
the 3rd party API. Each subdomain would submit a workload to the queue and
corresponding worker (multiple instances of the same workers exists
simultaneously) would execute it. I've written the worker using the same
code base and do just switch the db connection details on the fly. This
work alright when the worker instance(s) are dealing with one subdomain
connection details at a given time. My problem is that if more than one
workload is from different subdomains are being served by the gearman
workers in parallel,some of the data fetched from one subdomain ends up
being in the other subdomain. The db config is probably being switched
because of the underlying cakephp core cache? Singleton?

I was wondering if its the case. Its kinda a difficult debugging what the
issue is. It would be immensely helpful if you could throw me some
pointers.

Thanks,

-Ketan.

http://www.innovatechnologies.in


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dr. Tarique Sani  
View profile  
 More options Sep 15 2012, 7:04 am
From: "Dr. Tarique Sani" <tariques...@gmail.com>
Date: Sat, 15 Sep 2012 16:33:58 +0530
Local: Sat, Sep 15 2012 7:03 am
Subject: Re: Cakephp, gearman workers and changing database connection on the fly issue
Are you sending which DB to use in the workload and then switching the
DB in the worker accordingly?

T

On Sat, Sep 15, 2012 at 9:59 AM, Ketan <ketan.s...@gmail.com> wrote:
> howdy!

> We have created a SaaS app using cakephp 1.3 which is pulling in data from a

--
=============================================================
PHP for E-Biz: http://sanisoft.com
=============================================================

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ketan Shah  
View profile  
 More options Sep 15 2012, 9:17 am
From: Ketan Shah <ketan.s...@gmail.com>
Date: Sat, 15 Sep 2012 18:46:55 +0530
Local: Sat, Sep 15 2012 9:16 am
Subject: Re: Cakephp, gearman workers and changing database connection on the fly issue
Thats correct. I am sending the db config info in the workload

Sent from my iPhone

On 15-Sep-2012, at 4:33 PM, "Dr. Tarique Sani" <tariques...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dr. Tarique Sani  
View profile  
 More options Sep 17 2012, 12:41 am
From: "Dr. Tarique Sani" <tariques...@gmail.com>
Date: Mon, 17 Sep 2012 10:10:59 +0530
Local: Mon, Sep 17 2012 12:40 am
Subject: Re: Cakephp, gearman workers and changing database connection on the fly issue

On Sat, Sep 15, 2012 at 6:46 PM, Ketan Shah <ketan.s...@gmail.com> wrote:
> Thats correct. I am sending the db config info in the workload

Paste the code that you are using to change the DB

This should not happen because every workload is processed in its own
thread and they do not share anything. The DB connection should not
get cached

Tarique

--
=============================================================
PHP for E-Biz: http://sanisoft.com
=============================================================


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ketan Shah  
View profile  
 More options Sep 17 2012, 12:48 am
From: Ketan Shah <ketan.s...@gmail.com>
Date: Mon, 17 Sep 2012 10:18:34 +0530
Local: Mon, Sep 17 2012 12:48 am
Subject: Re: Cakephp, gearman workers and changing database connection on the fly issue

Thanks Tarique,

Here you go. http://pastebin.com/ezCBqyGV

On Mon, Sep 17, 2012 at 10:10 AM, Dr. Tarique Sani <tariques...@gmail.com>wrote:

--
"If you don't risk anything in life, you are risking even more"

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dr. Tarique Sani  
View profile  
 More options Sep 17 2012, 6:12 am
From: "Dr. Tarique Sani" <tariques...@gmail.com>
Date: Mon, 17 Sep 2012 15:41:46 +0530
Local: Mon, Sep 17 2012 6:11 am
Subject: Re: Cakephp, gearman workers and changing database connection on the fly issue
Looks fine...  No more ideas - sorry

T

--
=============================================================
PHP for E-Biz: http://sanisoft.com
=============================================================

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ketan Shah  
View profile  
 More options Sep 17 2012, 8:17 am
From: Ketan Shah <ketan.s...@gmail.com>
Date: Mon, 17 Sep 2012 17:46:58 +0530
Local: Mon, Sep 17 2012 8:16 am
Subject: Re: Cakephp, gearman workers and changing database connection on the fly issue

No worries Tarique. Thanks for your time.

I've wasted too much time only to realise that remote mysql connection is
kinda slow. So we decide to build an API on top of cakephp which would
consume this data. Worked out to be lot faster.

cheers,
-Ketan.

On Mon, Sep 17, 2012 at 3:41 PM, Dr. Tarique Sani <tariques...@gmail.com>wrote:

--
"If you don't risk anything in life, you are risking even more"

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »