Closed parnurzeal closed 10 years ago
More information about DB. I have tried both mysql-5.6.15-osx10.7-x86_64 on mac os x. And using MariaDB10 on CentOS6.3
They both have the problem.
prefix all your variables with var
:
var alldata = req.params.all();
var serial_no = ...
and try again
Hi @edy,
What a dumb I am! Thanks very much! This solved my problem.
@parnurzeal use .jshint
that warns you that kind of thing
The Sublime text 3 has the sublime linter
and have to grunt and npm modules for jshint
@albertosouza Very useful. Thank you very much! I am using it now.
Salis-version: 0.10.0-rc7 Connector: sails-mysql
I now encounter a problem that sails gets update into the "WRONG" record. What I tried to do was just sending lots of normal GET requests to sails and tried to update 5-6 different records at the same time. What happened was data that got update in other field got update into other records. This is serious issue.
Follows are my cutting part of related schema and custom controllers I am using:
ServerController.js (controller)
Server.js (model)
Prov_state.js
What I did is just looping curl GET to url
http://localhost:1337/server
And also running update on 4 records to change prov_state number from 1-4 ( increasing 1 number per second and change back to 1 if it is already 4)
curl localhost:1337/server/update -i -X POST -H 'Content-Type: application/json' -d '{"serial_no":"QTFC9S3060011", "prov_state":"[number 1->4]"}'
but updating 1 record to change prov_state number from 5-12 ( increasing 1 number per second and change back to 5 if it is already 12)
curl localhost:1337/server/update -i -X POST -H 'Content-Type: application/json' -d '{"serial_no":"QTFC9S3060011", "prov_state":"[number 5->12]"}'
What happened was other 4 records got update to some different number like 5 - 12 !!!
I don't think I am implementing anything weird in my custom controller. Please do help if I use the version that having the problem and need to upgrade to other version.