IntelliJ IDEA调试时点击停止按钮,程序并没有立即停止

Background

调试一段循环更新数据库的程序时,在更新语句处设置了一个断点,明明在更新了一条数据后停止了Debug,但是数据库里的数据却更新了2条。。

IntelliJ IDEA版本信息:

IntelliJ IDEA 2019.3.3 (Ultimate Edition)
Build #IU-193.6494.35, built on February 11, 2020
Licensed to XX
Subscription is active until August 17, 2021
For educational use only.
Runtime version: 11.0.5+10-b520.38 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
GC: ParNew, ConcurrentMarkSweep
Memory: 984M
Cores: 4
Registry: debugger.watches.in.variables=false, compiler.automake.allow.when.app.running=true
Non-Bundled Plugins: Lombook Plugin, org.intellij.scala

Analysis

经过分析,得出结论:在点击停止按钮时,程序并没有立即终止。以上问题可抽象为下面的“Hello World”。

一个简单的Hello World,在打印World这一行设置断点,调试启动,到了断点处,此时控制台已打印出Hello,这时,直接点击停止,然而,并没有按预期地进行停止?!。赫然打印出了Hello World

    public static void main(String[] args) {
        System.out.print("Hello ");
        System.out.println("World");
    }

2020-11-23-IdeaDebugBreakPoint.png
2020-11-23-IdeaStop.gif
2020-11-23-IdeaNoStop.png

Solution

解决方案:在Frames窗口,点击Force Return

2020-11-23-IdeaForceReturn.png

If you have any questions or any bugs are found, please feel free to contact me.

Your comments and suggestions are welcome!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Heartsuit

别说什么鼓励,这就是互联网乞讨

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值