Displaying 20 results from an estimated 10000 matches similar to: "Mysql too many connections"
2006 Jul 31
1
MySQL too many connections?
Does any have any idea why I would get:
Mysql::Error: Too many connections
I am creating new threads in my background process. I know
allow_concurrency is set to true. Does this create a new database
connection when a new thread is created? Because what I''m doing is
similar to this:
@threads[model.id] = Thread.new do
end
I also kill off these threads and over write some of the
2006 Jul 31
1
Creating workers on server startup?
I have workers that need to be created when I run rake
backgroundrb:start. Where do I put this code?
Thanks for your help.
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060731/d201c052/attachment.html
2006 Aug 24
1
ActionMailer doesn''t work in backgroundrb
I am pretty confident that mailers do not work in backgroundrb. Can
anyone confirm this? Because when I try to do
Notifier.deliver_some_method I get an error saying it cant find the
templates for my email. The funny thing is that when I run script/
runner Notifier.deliver_some_method it works just fine. Any ideas?
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
O: 800-341-6826
M:
2006 Jul 31
1
delete_worker doesn''t kill the thread?
I made a worker that run an infinite loop and does the following:
while true
@logger << "logging #{Time.now}"
sleep 2
end
In my secong console I did:
tail log/backgroundrb.log -f
This is so I could see the line getting added to the log every 2
seconds.
Then in my other console I started script/console and created a new
worker. Then killed it with
2006 Aug 28
1
Just a tip
I figured instead of asking a question I would share some useful
knowledge I learned this week. Maybe you already know this, maybe you
dont.
If you use backgroundrb to run an "infinite" loop, or create many
threads, or do quite a bit of processor intensive tasks, and you
notice that its running kind of slow, it might not be a bad idea to
have multiple backgroundrb processes
2006 Jul 07
2
Problems installing, please help
I am in my rails project directory and I ran the following command:
script/plugin install svn://rubyforge.org//var/svn/backgroundrb
and I get this:
sh: svn: command not found
Any idea how I can install backgroundrb or what the problem is?
Any help is greatly appreciated.
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
O: 800-341-6826
M: 817-229-4258
-------------- next part
2006 Aug 19
1
Setting the process priority?
Is it possible to make the process priority higher for backgroundrb?
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060819/7a2e6d1b/attachment.html
2006 Jul 07
1
uninitialized constant MiddleMan
I just updated backgroundrb to the latest version, and now I get this:
uninitialized constant MiddleMan
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/
active_support/dependencies.rb:123:in `const_missing''
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/
active_support/dependencies.rb:131:in `const_missing''
2006 Jul 31
1
Please help, if @jobs[key].respond_to? :thread is returning false
I noticed in the BackgroundRB class in the delete_worker method there
is a line:
if @jobs[key].respond_to? :thread
For some reason this is returning false for me, it gets down to this
line and returns false, not killing the thread. Any idea why this is
returning false?
Thanks for your help.
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
-------------- next part --------------
An
2006 Aug 06
3
Debugging a worker?
If there is an exception raised in my worker I rescue it and throw it
into the log. This is decent, but it would really help to find out
more information. Like the line number, the stack trace, etc. Is this
possible?
Thanks for your help.
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Aug 18
1
Ezra....allow_concurrency = false?
In a previous email you wrote this:
Glad you''re getting some use out of the plugin ;) ActiveRecord does
have some issues with threading and concurrency that can sometimes
cause that error you are seeing. Open up your script/backgroundrb/
start file and comment out the following line:
ActiveRecord::Base.allow_concurrency = true
Make sure you do that up in your main app script folder
2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex
class.
Now that backgroundrb has allow_concurrency = true there is no need
to synchronize database calls in threads.
The question I have is lets say I have a simple method in my worker
as follows:
def some_method
SomeModel.find_all each do |obj|
obj.some_count += 1
obj.save!
end
end
It accesses the database, but
2006 Jul 19
1
Passing objects to drb, does it keep the existing db connection?
I have a simple question. Let''s say I do this in one of my models:
after_save
drb_conn.some_method(self)
end
When that object gets over to the background process is it the exact
same as?....
Model.find some_id #in the background process
As far as my background process is concerned passing the object is
not any different than passing the id and using the find method?
Because
2006 Aug 01
4
Creating workers from workers?
Since MiddleMan is an uninitialized constant in a worker how do you
create new workers inside a worker?
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
O: 800-341-6826
M: 817-229-4258
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060731/75a77fa6/attachment-0001.html
2006 Jul 22
1
Problem with drbundumped?
I''m not sure if this is a problem or not, but it definitely henders
the way one would use the passing of objects to the drb server. Isn''t
the point of passing objects to the drb server to act like its
passing to just another local method? When I pass an object to the
drb server a lot of the useful methods are gone. Such as id() or class
() or inspect(), etc. I spent a
2006 Jul 17
2
Very strange after_save problem. Please help.
I have a very strange problem here. I do not get this. So any help is
greatly appreciated.
Basically I have a model that calls a method in the background
process in the "after_save" method. Let''s call the model products. So
what happens is this:
1. I create a new product.
2. Everything works and the product is saved with id 13.
3. A method is called in my background
2006 Jul 31
0
BackgroundRB time is not consistent with rails.
I added the following in my rails environment:
ENV[''TZ''] = ''UTC''
Background rb does not have the same time as my rails app. In fact it
is a few hours behind. Any idea why this is?
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jul 08
0
Question about killing threads
If I do the following:
threads = []
threads[0] << Thread.new do
while true
# some code
end
end
# Will this kill off the first thread?
threads[0] << Thread.new do
while true
# some more code
end
end
Will the second assignment kill off the first thread? Or will that
first thread keep going and never stop unless i explicitly kill it
using the Thread.kill method?
Thanks for
2006 Jul 12
0
Initialize limited?
Can I not do things with the models in my initialize method? I have
this:
def initialize(args)
super args
i = 0
Event.find_all do |event|
@lock = i
i += 1
end
end
i is null and there are events in the database. Any ideas how I can
use my models in the initialize method?
Thank You,
Ben Johnson
E: bjohnson at contuitive.com
O: 800-341-6826
M: 817-229-4258
-------------- next part
2006 Jul 19
1
Catch 22 with after_save. Please help.
I have a pretty strange problem. Here is basically what I have to
demonstrate my problem:
class Event < ActiveRecord::Base
def after_create
AnotherClass.find_event(id)
end
end
class AnotherClass < ActiveRecord::Base
def self.find_event(event_id)
e = Event.find event_id
end
end
Here is the catch 22 and it''s quite annoying. Basically ActiveRecord
puts to whole save