Eclipse 在获取会话代码时暂停且没有断点
调试时,我的 Eclipse 每次都会在同一行暂停。我读了这篇 Eclipse Pausing without a Breakpoint,但我的控制台中没有任何异常。我还读过这个 为什么我的 Eclipse 项目有幻像调试器断点? ,但这也没有帮助。
无断点暂停调试器的代码是这样的:
Query query = sessionFactory.getCurrentSession().createQuery(hql);
我认为createQuery()
没有问题。每当调用 getCurrentSession() 时,我的 Eclipse 都会暂停。为什么会发生这种情况?
While debugging, my Eclipse pause on same line every time. I read this Eclipse pausing without a breakpoint, but there are no exceptions in my console. I also read this Why does my Eclipse project have phantom debugger breakpoints?, but it doesn't help too.
The code that pauses debugger without breakpoint is this:
Query query = sessionFactory.getCurrentSession().createQuery(hql);
I think there's no problem with createQuery()
. Whenever getCurrentSession()
called, my Eclipse pauses. Why is this happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
研究一下并发性。也许你遇到了僵局之类的情况。当两个对象没有以相同的顺序锁定时,就会发生这种情况,导致两个不同的线程互相等待对方释放另一个对象。
至此,整个程序似乎已经暂停了。也许是发生了什么,但在我看到代码之前不能确定。
Look into concurrency. Maybe ur running into situations like deadlock. It happens when two objects are not locked in the same order, causing two different threads to be waiting for each other to release other object.
At this point it appears that the entire program has paused. Maybe its whats happening, but cant say for sure until I can see the code.
有时我会遇到这种问题,每次我最终发现我的java代码与我的.class不同步时,这种情况发生在我进行远程调试时。尝试关闭您的 Eclipse,清理您的项目,然后重试。如果您要远程调试,请更新源代码。
干杯!
Sometimes I face this kind of problem and everytime I end up finding out that my java code is not synchronized with my .class, this happens when I'm in remote debugging. Try to close your eclipse, clean your project and then try again. If you're debugging remotely, update your source codes.
Cheers!
简单的。应用程序始终是多线程的。显然该应用程序在另一个线程中停止。当您分析 Eclipse 在哪个步骤上停止并单击该线程时,您会发现 Eclipse 开始对命令做出反应。
Simple. Application always multithreading.. Obvously that application stop in another thread. When you analyze on which tread Eclipse stop and click on this thread - you found that Eclipse starts to react on command.