V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  JasonLaw  ›  全部回复第 37 页 / 共 37 页
回复总数  739
1 ... 28  29  30  31  32  33  34  35  36  37  
2020 年 7 月 2 日
回复了 JasonLaw 创建的主题 数据库 MySQL 插入意向锁的作用是什么?
@luckyrayyy 在[https://dev.mysql.com/doc/refman/8.0/en/innodb-locking.html]( https://dev.mysql.com/doc/refman/8.0/en/innodb-locking.html)中,介绍了意向锁和插入意向锁。它说`Intention locks are table-level locks that indicate which type of lock (shared or exclusive) a transaction requires later for a row in a table.` & `An insert intention lock is a type of gap lock set by INSERT operations prior to row insertion.`。我同意你前面所说的,但是对于“然后其他事物想锁表的时候看到有个意向锁,就得阻塞等着”,我并不同意。在 http://codex.cs.yale.edu/avi/db-book/db6/slide-dir/PPT-dir/ch15.ppt 里的第 25 页,有一个兼容性矩阵,比如说一个事务拥有 IS 类型表级意向锁,另外一个事务还是可以获取到 S 类型的表级锁的。
@lpts007 书籍的版本是第六版(中文版和英文版都没有包含 commited 限定),应该是书籍的小错误。谢谢啦。
@lpts007 谢谢。不过书中所说的跟 PPT 所说的不太一样。书中的"redoes all the actions since the most recent dump occurred"不是应该换成"redo all transactions that committed after the dump"吗?

书中所说的:
To recover from the loss of nonvolatile storage, the system restores the database to disk by using the most recent dump. Then, it consults the log and **redoes all the actions since the most recent dump occurred**.

PPT 所说的:
To recover from disk failure
1. restore database from most recent dump.
2. Consult the log and **redo all transactions that committed after the dump**.
@lpts007 你看看 https://www.db-book.com/db6/slide-dir/PPT-dir/ch16.ppt 的 25 页,并不是你所说的那样。

Recovery from failure: Two phases
1. Redo phase: replay updates of all transactions, whether they committed, aborted, or are incomplete
2. Undo phase: undo all incomplete transactions
@lpts007 文章所说的是“然后,根据日志,重做最近一次转储后所做的所有动作。”,是所有的动作,并不是已结束的事务所做的动作。
我觉得它们之间还是存在依赖性的,只有满足“Tk 的写阶段在 Ti 开始其有效性检查阶段之前完成”,才能进行“Tk 所写的数据项集与 Ti 所读数据项集是否相交”的判断。
@aijam 😂明白了,谢谢🙏。不过很奇怪,这个错误没有在 https://www.db-book.com/db6/errata-dir/errata-part4.pdf 列出。
@aijam 你说得对,那么说,不是应该将“ Tk 所写的数据项集与 Ti 所读数据项集不相交,并且 Tk 的写阶段在 Ti 开始其有效性检查阶段之前完成( Start(Ti) < Finish(Tk) < Validation(Ti))”替换成“ Tk 的写阶段在 Ti 开始其有效性检查阶段之前完成( Start(Ti) < Finish(Tk) < Validation(Ti)),并且 Tk 所写的数据项集与 Ti 所读数据项集不相交”吗?
@aijam 其实两个版本说的是一样的,只不过事务的名称变了而已。我不明白的是为什么还需要“Tk 的写阶段在 Ti 开始其有效性检查阶段之前完成( Start(Ti) < Finish(Tk) < Validation(Ti))”。
2020 年 6 月 11 日
回复了 zero47 创建的主题 程序员 使用 MongoTemplate 如何优雅地避免魔法值
2020 年 6 月 6 日
回复了 ooo1 创建的主题 分享发现 前端框架的利于弊
@ooo1 How much research effort is expected of Stack Overflow users? - Meta Stack Overflow

https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users

看了你就会明白为什么大家对你这样子了。
2020 年 6 月 5 日
回复了 ooo1 创建的主题 分享发现 前端框架的利于弊
首先你想讨论一个东西的话,自己先做一下调研,不要一下子就把问题扔给别人,这样子太不负责。要是你在 stack overflow 提问的话,你这个问题就是不符合社区规范的。你碰到了什么问题?你做了调研吗?你发现了什么?你不明白什么?你什么都没说,你叫别人怎么看你?你叫别人怎么帮你?
2020 年 6 月 1 日
回复了 qqqccc 创建的主题 程序员 fastjson 又爆 bug 了!快来看看是否受影响
@whoami9894 产生对象的 class 是自己写的,setXX 能做什么不是完全由自己决定的吗?实例化 class 的一个对象后,会根据序列化之后的内容对属性设置不同的值。如果 setXX 方法除了赋值之外还做了“其他的事情”,不管是什么方式的反序列化,都会做“其他的事情”的呀😅,不会取决于“序列化的内容是否被修改”。是我哪里没有理解吗?😯
2020 年 6 月 1 日
回复了 qqqccc 创建的主题 程序员 fastjson 又爆 bug 了!快来看看是否受影响
@sayuria 我还是有点不明白,就算替换了内容,那也是数据(对象的属性)改变了,代码执行的逻辑还是不变的。可以具体讲解一下“怎么造成安全漏洞”的吗?
2020 年 6 月 1 日
回复了 JasonLaw 创建的主题 MongoDB MongoDB Aggregation Pipeline 并没有使用索引
?我有一点疑问,这个问题已经有答案了(见附言),为什么还有人收藏呢?
2020 年 6 月 1 日
回复了 linxiaoziruo 创建的主题 Java Java 多线程问题
来自 Java Concurrency in Practice 。

Just as each Java object can act as a lock, each object can also act as a condition queue, and the wait, notify, and notifyAll methods in Object constitute the API for intrinsic condition queues. An object’s intrinsic lock and its intrinsic condition queue are related: in order to call any of the condition queue methods on object X, you must hold the lock on X. This is because the mechanism for waiting for state-based conditions is necessarily tightly bound to the mechanism for preserving state consistency: you cannot wait for a condition unless you can examine the state, and you cannot release another thread from a condition wait unless you can modify the state.

Object.wait atomically releases the lock and asks the OS to suspend the current thread, allowing other threads to acquire the lock and therefore modify the object state. Upon waking, it reacquires the lock before returning. Intuitively, calling wait means “I want to go to sleep, but wake me when something interesting happens”, and calling the notification methods means “something interesting happened”.
2020 年 5 月 31 日
回复了 JasonLaw 创建的主题 MongoDB MongoDB Aggregation Pipeline 并没有使用索引
From [\[SERVER-30474\] leading $facet with each facet beginning with $match should add $match before $facet - MongoDB]( https://jira.mongodb.org/browse/SERVER-30474), *$facet is not smart enough to use an index. if the only stage in a pipeline is $facet, the planning system will simply default to a COLLSCAN.*
2020 年 5 月 29 日
回复了 x97bgt 创建的主题 问与答 Java 里咋统计一个方法调用的次数?
AOP != 动态代理
我只是想问一下深圳现在的薪资状况,这样的水平,能在深圳拿到 15 到 20k 吗?在广州大概值多少呢?
1 ... 28  29  30  31  32  33  34  35  36  37  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2956 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 36ms · UTC 06:00 · PVG 14:00 · LAX 23:00 · JFK 02:00
♥ Do have faith in what you're doing.