Concurrency problem with ActiveRecord

44 views
Skip to first unread message

Serg Fedosov

unread,
Apr 15, 2014, 6:27:48 AM4/15/14
to golia...@googlegroups.com
Hi!
I have some error with AR 4.x.
I get code from examples/activerecord folder and little change this https://gist.github.com/Wolfer/10720433.
When I run a simple benchmark (ab -n 200 -c 20 -T application/json -p /tmp/post_data "http://localhost:9000/"), I get the following error: https://gist.github.com/Wolfer/10720744
What am I doing wrong?

Thank you.
P.S. sorry for my bad english


blackanger

unread,
Apr 25, 2014, 6:18:00 AM4/25/14
to golia...@googlegroups.com

body = env['rack.input'].read
MessageLog.create request: body

    the body is raw post , like "name=xx&city=bj",  you can't use it directly

Serg Fedosov

unread,
Apr 27, 2014, 4:36:37 AM4/27/14
to golia...@googlegroups.com
In my case need write raw input to database.
In any case, it is not important for subject error. Code like

# env['rack.input'].rewind
# body = env['rack.input'].read
MessageLog.create request: 'anything string'

generates the same error


пятница, 25 апреля 2014 г., 14:18:00 UTC+4 пользователь blackanger написал:
Reply all
Reply to author
Forward
0 new messages