我在不同的函数中使用id变量。id是在函数之外定义的。这是否会导致变量在接收多个同时请求时被覆盖?当这是在浏览器而不是在Node.js中完成时,行为是否相同?
var id;
server.get('/myapp', function (req, res, next) {
id = uuid.v4();
}
我试着把它放在一个句子里,但最好是举个例子:
SELECT * FROM someTable WHERE id = someID;
returns no rows
...
some time passes (no inserts are done to the table and no ID updates)
...
SELECT * FROM someTable WHERE id = someID;
returns one row!
有没有可能某些DB机制阻止first SELECT返回row?
Oracle日志没有错误。
执行两个selects时,不会回滚任何事务。