Displaying 8 results from an estimated 8 matches for "pierrew".
Did you mean:
pierre
2013 Jan 03
6
How to avoid simple race conditions with Session?
Here is the situation:
- the client makes a request
- it is followed by AJAX polling
The server needs to keep track of some stuff during this process.
I have been using the Session and it "mostly" works… until the user
decides to open another tab in her browser and she makes a new,
parallel request. In this case, the data from the two requests is
merged, which leads to bugs.
This got
2013 Feb 25
3
ActiveRecord associations: design question
Hi guys,
In my Rails app, I have three models: A, B and C, with the following
relationships:
- B hasMany C
- C belongsTo B
I would like A to "has_one" instance of B+C. By that I mean A needs to
be linked to a specific instance of B AND a specific instance of C.
My first guess would be to create a fourth object, say B_plus_C that
would:
- belongs to B
- belongs to C
- belongs to A
Is
2012 Apr 02
10
Pessimistic locking locks the entire table?
Hi guys,
I must be missing something obvious with pessimistic locking. Here is
what I do (Rails 2.3, mySQL):
In my Foo model:
def test
Foo.transaction do
lock = UpdateLockForFoo.find_by_foo_id(self.id, :lock => true)
sleep 30
end
end
For each Foo model, I have an UpdateLockForFoo. This "lock" needs to
be acquired before doing any changes to Foo.
I believe it works,
2009 Oct 04
3
Problem using ActiveRecord find with :joins and :select
Hi guys,
When I do:
temp = User.find(:all,
:joins => "INNER JOIN contents ON users.agent_id =
contents.id",
:select => "contents.id, users.id, users.u_date")
temp.first.inspect
It seems to work fine, but it only returns:
#<User id: 6, u_date: "2009-10-03 19:32:23">
but not the contents.id information.
I
2010 Jan 10
3
Need advice: threads or Typhoeus?
Hi guys,
I need my app to make a few hundreds requests to external web services
as quickly as possible. The web services are fairly fast, but still:
if I do the requests one after the other, it is too slow.
My understanding is I have two options:
a- Threads.
b- Typhoeus
Typhoeus seems great. Yet, the web services are all quite different
(some are SOAP, some REST...) and therefore wrapped into
2010 Feb 07
0
Tip to compile a 32bit version of Ruby on Snow Leopard
Hi guys,
I hope it''s not too off topic on a Rails forum, but I spent so much
time on this I thought I should share it here - hopefully it will help
other people.
I had to compile a 32bit (i386) version of Ruby 1.8.7 on Snow Leopard
(my app is using a 32bit only lib). So I configured the compilation as
such:
./configure CFLAGS="-arch i386 -D_XOPEN_SOURCE=1" LDFLAGS="-arch
2010 Jun 02
0
Multiple threads writing to the same Starling queue doesn't work?
Hi guys,
I can''t find a clear answer to this: is it possible/correct to have
several threads write to the same Starling queue at the "same time"?
It doesn''t seem reliable according to my tests - but maybe I am doing
something wrong.
If I do:
def test_starling
FooWorker.asynch_foo_test(:my_id => ''foo'')
temp = []
for i in 1..1000
temp
2010 Aug 02
2
How to monitor Cron jobs?
Hi guys,
I understand how to monitor long running processes with monit or god,
but I don''t understand how to monitor Cron jobs (for memory bloating
notably) since such processes
- always have different PIDs when they start
- are precisely supposed to stop when they are done, then restart when
asked (vs running all the time).
I have been looking on the web for a while, but